Skip to content

Commit

Permalink
Fix git-sha display
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Nov 12, 2024
1 parent 25943d2 commit 4cd6972
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ remote-pull:

compose:
docker-compose -f deploy/compose.yml up --build -d; \
docker-compose -f deploy/compose.yml up --build -d --force-recreate alloy
GIT_SHA=$(git rev-parse HEAD) docker-compose -f deploy/compose.yml up --build -d --force-recreate alloy
3 changes: 3 additions & 0 deletions deploy/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ services:
build:
context: /flamebin/qa/flamebin.dev/
dockerfile: deploy/Dockerfile
args:
VERSION: develop
GIT_SHA: ${GIT_SHA}
networks:
- shared
expose:
Expand Down
15 changes: 7 additions & 8 deletions src/flamebin/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@

:build {:nested
{:version {:type :string
:default "unknown"
:delayed-transform
#(if (and (= % "unknown") (.exists (io/file "VERSION")))
(slurp "VERSION") %)}
:default #(if (.exists (io/file "VERSION"))
(slurp "VERSION")
"unknown")}
:git-sha {:type :string
:default "master"
:delayed-transform
#(if (and (= % "master") (.exists (io/file "GIT_SHA")))
(slurp "GIT_SHA") %)}}}
:default #(or (and (.exists (io/file "GIT_SHA"))
(some->> (slurp "GIT_SHA") not-empty
(take 6) (apply str)))
"master")}}}
:storage {:nested
{:kind {:type :keyword
:default :disk}
Expand Down
2 changes: 1 addition & 1 deletion src/flamebin/web/pages.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
content
[:footer {:style "text-align:right; padding-botton: 20px"}
[:p (format "Build: %s (%s)" (@config :build :version)
(some-> (@config :build :git-sha) (subs 0 6)))]]]
(@config :build :git-sha))]]]
rst)])))

(defn upload-page []
Expand Down

0 comments on commit 4cd6972

Please sign in to comment.