refactoring , dockerizing
This commit is contained in:
17
environment/dev/docker/app/scripts/build.docker.build.step.inc.version.sh
Executable file
17
environment/dev/docker/app/scripts/build.docker.build.step.inc.version.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# set the actual commit date and commit hash in version.txt
|
||||
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
GIT_BRANCH_SHORT=$(echo $GIT_BRANCH | cut -d "/" -f 1)
|
||||
GIT_COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y%m%d%H%M)
|
||||
GIT_COMMIT_ID_SHORT=$(git rev-parse --short HEAD)
|
||||
|
||||
VERSION=$GIT_COMMIT_DATE.$GIT_COMMIT_ID_SHORT
|
||||
|
||||
CURRENT_DIR=$(dirname "$0")
|
||||
VERSION_FILE="${CURRENT_DIR}/version.txt"
|
||||
|
||||
echo "Saving version ${VERSION} to file ${VERSION_FILE}"
|
||||
|
||||
echo $VERSION
|
||||
echo $VERSION > $VERSION_FILE
|
||||
|
||||
Reference in New Issue
Block a user