feat(CI): add commit hashes to the automatic SQL import (#1516)

This commit is contained in:
Stoabrogga
2019-02-25 11:30:43 +01:00
committed by GitHub
parent 15622225d6
commit 845a3b65db
2 changed files with 11 additions and 2 deletions
+9
View File
@@ -6,6 +6,8 @@ source "$CURRENT_PATH/../bash_shared/includes.sh"
UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates/"
COMMIT_HASH=
function import() {
db=$1
folder="db_"$db
@@ -97,6 +99,13 @@ function import() {
echo "DROP PROCEDURE IF EXISTS \`updateDb\`;" >> "$newFile";
fi;
currentHash="$(git log --diff-filter=A "$entry" | grep "^commit " | sed -e 's/commit //')"
if [[ "$COMMIT_HASH" != *"$currentHash"* ]]
then
COMMIT_HASH="$COMMIT_HASH $currentHash"
fi
rm $entry;
oldDate=$dateToday