Create a auto build docker image

Version of application is calculated by the git tags
This commit is contained in:
2020-05-13 18:20:57 +02:00
parent e4a85722f1
commit 159b9de19a
8 changed files with 150 additions and 9 deletions

12
hook/version.sh Normal file
View 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