Automatic changes

Reload some script after changing git hash
This commit is contained in:
Martin Blazik
2020-10-29 21:42:30 +01:00
parent f04ee51fb1
commit 287a9a714c
4 changed files with 19 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
/tmp/
/opt/bin/*
/opt/*
/var/version
.mypy_cache/
!/**/.gitkeep

1
rc/version.sh Normal file
View File

@@ -0,0 +1 @@
$WORKSPACE/scripts/changes.sh

17
scripts/changes.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# process changes from last commit
set -u
VERSION_FILE=$WORKSPACE/var/version
last_version=$(cat $VERSION_FILE 2> /dev/null)
current_version=$(git rev-parse HEAD)
if [[ "$last_version" != "$current_version" ]]; then
echo "Git version changed. Running changing scripts"
$WORKSPACE/scripts/git-config.sh
echo "$current_version" > $VERSION_FILE
fi

0
var/.gitkeep Normal file
View File