Fix issues with showing version footer in uberjar

* re-implement getting git HEAD sha to cljs side due to system
  properties not containing project version in uberjar profile
This commit is contained in:
Teemu Patja 2017-03-09 15:47:29 +02:00
parent 817466c636
commit 2d788cad32
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
5 changed files with 17 additions and 13 deletions

View File

@ -1,8 +1,6 @@
(defproject commiteth "0.1.0-SNAPSHOT"
:description "Ethereum bounty bot for Github"
:url "https://commiteth.com"
:dependencies [[metosin/compojure-api "1.1.10"]
[re-frame "0.9.1"]
[cljs-ajax "0.5.8"]
@ -46,8 +44,7 @@
[cljsjs/moment "2.17.1-0"]
[org.clojure/tools.nrepl "0.2.12"]
[com.cemerick/piggieback "0.2.1"]
[jarohen/chime "0.2.0"]
[lein-sha-version "0.1.1"]]
[jarohen/chime "0.2.0"]]
:min-lein-version "2.0.0"
:source-paths ["src/clj" "src/cljc"]
@ -63,7 +60,8 @@
[lein-cljsbuild "1.1.3"]
[lein-auto "0.1.2"]
[lein-less "1.7.5"]
[cider/cider-nrepl "0.14.0"]]
[cider/cider-nrepl "0.14.0"]
[lein-sha-version "0.1.1"]]
:less {:source-paths ["src/less"]
@ -93,8 +91,7 @@
:externs ["externs/web3-externs.js"]
:optimizations :advanced
:pretty-print false
:closure-defines {goog.DEBUG false
commiteth.core/version ~(System/getProperty "commiteth.version")}
:closure-defines {goog.DEBUG false}
:closure-warnings
{:externs-validation :off
:non-standard-jsdoc :off}}}}}
@ -118,8 +115,7 @@
[sablono "0.7.7"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.14.0"]
[lein-doo "0.1.7"]
[lein-figwheel "0.5.9"]
[lein-sha-version "0.1.1"]]
[lein-figwheel "0.5.9"]]
:cljsbuild
{:builds
[{:id "app"
@ -131,7 +127,6 @@
:output-dir "target/cljsbuild/public/js/out"
:source-map true
:optimizations :none
:closure-defines {commiteth.core/version ~(System/getProperty "commiteth.version")}
:pretty-print true}}]}
:doo {:build "test"}

View File

@ -35,6 +35,7 @@
if (user === "") {
user = null;
}
var commitethVersion = "{{commitethVersion}}";
</script>
{% script "/js/app.js" %}
</body>

View File

@ -2,10 +2,17 @@
(:require [commiteth.layout :as layout]
[compojure.core :refer [defroutes GET]]
[ring.util.response :refer [redirect]]
[ring.util.http-response :refer [ok header]]))
[ring.util.http-response :refer [ok header]]
[clojure.tools.logging :as log]
[clojure.java.io :as io]))
(defonce ^:const version (System/getProperty "commiteth.version"))
(defn home-page [{user-id :id login :login token :token}]
(layout/render "home.html" {:userId user-id :login login :token token}))
(layout/render "home.html" {:userId user-id
:login login
:token token
:commitethVersion version}))
(defroutes home-routes
(GET "/" {{identity :identity} :session}

View File

@ -20,7 +20,7 @@
[re-frisk.core :refer [enable-re-frisk!]])
(:import goog.History))
(goog-define version "unknown")
(defonce version js/commitethVersion)
(defn flash-message-pane []
(let [flash-message (rf/subscribe [:flash-message])]

View File

@ -328,6 +328,7 @@ span.dropdown.icon {
.version-footer {
color: #a8aab1;
font-size: .8em;
a {
&:hover {
color: #474951!important;