Differentiate git/release data for binary data embedding.

Fixes #10.
This commit is contained in:
Stanislav Nikitin 2021-02-19 19:24:42 +05:00
parent 10d761f07d
commit edfbd5a90d
Signed by: pztrn
GPG Key ID: 1E944A0F0568B550
4 changed files with 13 additions and 3 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.1.1-dev

View File

@ -1,7 +1,6 @@
# Gets git data. # Gets git data.
# Should be sourced where neccessary. # Should be sourced where neccessary.
export BRANCHNAME=${BRANCHNAME:=$(git branch --no-color --show-current)} export BRANCHNAME=${BRANCHNAME:=$(git branch --no-color --show-current)}
export BUILDID=${BUILDID:=$(git rev-list HEAD --count)} export BUILDID=${BUILDID:=$(git rev-list HEAD --count)}
export COMMITHASH=${COMMITHASH:=$(git rev-parse --verify HEAD)} export COMMITHASH=${COMMITHASH:=$(git rev-parse --verify HEAD)}
export VERSION=${VERSION:="0.1.0-dev"} export VERSION=${VERSION:=$(cat VERSION)}

View File

@ -0,0 +1,6 @@
# Overrides some variables for release.
export VERSION=$(cat VERSION)
export BRANCHNAME="release/${VERSION}"
export COMMITHASH="none"
export BUILDID="0"

View File

@ -1,7 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Showing git data in console. # Showing git data in console.
source ./scripts/shell_helpers/get_git_data.sh if [ -d .git ]; then
source ./scripts/shell_helpers/get_git_data.sh
else
source ./scripts/shell_helpers/get_release_data.sh
fi
echo "* Branch: ${BRANCHNAME}" echo "* Branch: ${BRANCHNAME}"
echo "* Build ID: ${BUILDID}" echo "* Build ID: ${BUILDID}"