Create a auto build docker image
Version of application is calculated by the git tags
This commit is contained in:
12
hook/version.sh
Normal file
12
hook/version.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [[ $(git describe --tags --dirty) =~ ^V?([0-9][0-9.]*(-dirty)?)$ ]]; then
|
||||
VERSION="${BASH_REMATCH[1]}"
|
||||
elif [[ $(git describe --tags --dirty) =~ ^V?([0-9][0-9.]*)-([0-9]+)-g(.+(-dirty)?)$ ]]; then
|
||||
VERSION="${BASH_REMATCH[1]}-${BASH_REMATCH[3]}"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $VERSION
|
||||
Reference in New Issue
Block a user