Skip to content

Commit

Permalink
Set git revision at build from env variable (#2428)
Browse files Browse the repository at this point in the history
* Set git revision at build from env variable

* Update develop/scripts/create_build_info_data.sh

Co-authored-by: Alex Shtin <alex@temporal.io>

* syntax

Co-authored-by: Alex Shtin <alex@temporal.io>
  • Loading branch information
feedmeapples and alexshtin authored Jan 28, 2022
1 parent f9c6ddf commit 6c1f2ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion develop/scripts/create_build_info_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -eu

build_info_data_file="build/info/data.json"

git_revision=$(git rev-parse --short HEAD) # "6cbfa2a3a"
git_revision="${GITHUB_SHA_SHORT:-$(git rev-parse --short HEAD)}" # "6cbfa2a3a"

build_time_unix=$(date '+%s') # seconds since epoch

echo '{"gitRevision":"'"${git_revision}"'","buildTimeUnix":'"${build_time_unix}"'}' > "${build_info_data_file}"

0 comments on commit 6c1f2ff

Please sign in to comment.