summaryrefslogtreecommitdiff
path: root/web-ui/config
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2015-09-15 14:47:43 +0200
committerFolker Bernitt <fbernitt@thoughtworks.com>2015-09-15 14:51:19 +0200
commitda2e8fa76a1e6daa1c0981c9bb54e04aa2674c98 (patch)
tree190b9d985197244ae5788fd86e12dc4841de950b /web-ui/config
parentfbf0663ed672aff425db09684e7ce1db9b7666e4 (diff)
Add git revision to web-ui on build
- Issue #453
Diffstat (limited to 'web-ui/config')
-rwxr-xr-xweb-ui/config/add_git_version.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/web-ui/config/add_git_version.sh b/web-ui/config/add_git_version.sh
new file mode 100755
index 00000000..2732abed
--- /dev/null
+++ b/web-ui/config/add_git_version.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+TEMPLATE_FILE="app/js/generated/hbs/templates.js"
+
+COMMITISH=$(git rev-parse --short HEAD)
+
+perl -pi -e "s/UNKNOWN_VERSION/$COMMITISH/" $TEMPLATE_FILE
+
+if [ ! -f "$TEMPLATE_FILE" ] ; then
+ echo "file $TEMPLATE_FILE not found" 1>&2
+ exit 1
+fi
+
+exit 0