WebTools-NG/script/getGitVer.sh

8 lines
303 B
Bash
Raw Permalink Normal View History

2020-10-16 22:40:27 +00:00
# Export rev to env, for the artifact
2020-10-16 21:48:09 +00:00
export AppRev=$(git rev-parse --short HEAD)
# Get git root directory
root=$(git rev-parse --show-toplevel 2>&1)
2020-10-16 22:40:27 +00:00
# get commit hash for version file
rev='{"rev":"'$(git rev-parse --short HEAD 2>&1)'"}'
# Save to version file
2020-10-16 22:40:27 +00:00
echo "$rev" > "$root/public/version.json"