diff --git a/Makefile b/Makefile index 46118cb..da2f945 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ # for syntax checks BASH_SCRIPTS = deployment.sh +VERSION=$(shell git log --pretty=format:"%h" -1 deployment.sh) syntaxcheck: shellcheck @@ -12,4 +13,8 @@ shellcheck: done; \ echo " done."; \ +script_version: + echo "Adjust version information string in deployment.sh to ${VERSION}" + sed -i "s/SCRIPT_VERSION=\"%SCRIPT_VERSION%\"/SCRIPT_VERSION=${VERSION}/" deployment.sh + # EOF diff --git a/deployment.sh b/deployment.sh index cf87083..dd8e25b 100755 --- a/deployment.sh +++ b/deployment.sh @@ -1,19 +1,13 @@ #!/bin/bash # Purpose: automatically install Debian + sip:provider platform ################################################################################ -# $Id$ -# $Rev$ -################################################################################ -# set version to svn revision information, initially enabled via -# svn propset svn:keywords 'Id Revision' deployment.sh -SCRIPT_VERSION="$Rev$" +# set version to git commit ID +SCRIPT_VERSION="%SCRIPT_VERSION%" # not set? then fall back to timestamp of execution -if [ -z "$SCRIPT_VERSION" ] || [ "$SCRIPT_VERSION" = '$' ] ; then +if [ -z "$SCRIPT_VERSION" ] || [ "$SCRIPT_VERSION" = '%SCRIPT_VERSION%' ] ; then SCRIPT_VERSION=$(date +%s) # seconds since 1970-01-01 00:00:00 UTC -else # we just want the ID from something like "$Rev$" - SCRIPT_VERSION=$(echo $SCRIPT_VERSION | awk '{print $2}') fi # Never ever execute the script outside of a