tiny improvements related with CI & submodules

This commit is contained in:
filux
2015-11-22 20:00:56 +01:00
parent e3d2cfb09b
commit 1a698f0225
6 changed files with 44 additions and 11 deletions

View File

@@ -24,7 +24,8 @@ if [ -f "$REPO_DATADIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
cd "$REPO_DATADIR"
DATA_BRANCH="$(git branch | grep '^* ' | awk '{print $2}')"
# on macos are problems with more advanced using awk ^
DATA_COMMIT="$(echo "[$(git rev-list HEAD --count).$(git log -1 --format=%h)]")"
DATA_COMMIT_NR="$(git rev-list HEAD --count)"
DATA_COMMIT="$(echo "[$DATA_COMMIT_NR.$(git log -1 --format=%h)]")"
DATA_HASH=$(git log -1 --format=%H)
fi
if [ -d "$REPODIR/.git" ] && [ "$(which git 2>/dev/null)" != "" ]; then
@@ -53,7 +54,15 @@ DATA_HASH_MEMORY="$RELEASEDIR_ROOT/data_memory"
DATA_HASH_FILE="$DATA_HASH_MEMORY/$VERSION-$SOURCE_BRANCH.log"
if [ ! -d "$DATA_HASH_MEMORY" ]; then mkdir -p "$DATA_HASH_MEMORY"; fi
if [ "$DATA_HASH" != "" ]; then
if [ ! -e "$DATA_HASH_FILE" ] || [ "$(cat "$DATA_HASH_FILE" | grep "$DATA_HASH")" = "" ]; then echo "$DATA_HASH" > "$DATA_HASH_FILE"; else exit 0; fi
if [ ! -e "$DATA_HASH_FILE" ]; then
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
elif [ "$(cat "$DATA_HASH_FILE" | grep "$DATA_HASH")" = "" ]; then
DATA_COMMIT_PREV_NR="$(cat "$DATA_HASH_FILE" | head -1 | awk '{print $2}')"
if [ "$DATA_COMMIT_PREV_NR" != "" ] && [ "$DATA_COMMIT_NR" -lt "$DATA_COMMIT_PREV_NR" ]; then
echo " warning: Detected older git revision of data than previously, $DATA_COMMIT_NR < $DATA_COMMIT_PREV_NR."
fi
echo "$DATA_HASH $DATA_COMMIT_NR" > "$DATA_HASH_FILE"
else exit 0; fi
fi
cd "$CURRENTDIR"

View File

@@ -72,9 +72,15 @@ rem Update from GIT to latest rev
ECHO --------------------------------
Echo Updating Code from GIT to latest Revision...
cd ..\..\
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd data\glest_game
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd ..\..\
git submodule update
git pull
git submodule foreach git pull
set GITVERSION_SHA1=.
set GITVERSION_REV=.

View File

@@ -96,9 +96,15 @@ rem Update from GIT to latest rev
ECHO --------------------------------
Echo Updating Code from GIT to latest Revision...
cd ..\..\
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd data\glest_game
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd ..\..\
git submodule update
git pull
git submodule foreach git pull
set GITVERSION_SHA1=.
set GITVERSION_REV=.

View File

@@ -84,9 +84,15 @@ rem Update from GIT to latest rev
ECHO --------------------------------
Echo Updating Code from GIT to latest Revision...
cd ..\..\
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd data\glest_game
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd ..\..\
git submodule update
git pull
git submodule foreach git pull
set GITVERSION_SHA1=.
set GITVERSION_REV=.

View File

@@ -78,9 +78,15 @@ rem Update from GIT to latest rev
ECHO --------------------------------
Echo Updating Code from GIT to latest Revision...
cd ..\..\
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd data\glest_game
set GIT_NORM_BRANCH=.
for /f "delims=" %%a in ('git branch ^| findstr /rc:"^\* (detached"') do @set GIT_NORM_BRANCH=%%a
if "%GIT_NORM_BRANCH%" == "." git pull
cd ..\..\
git submodule update
git pull
git submodule foreach git pull
set GITVERSION_SHA1=.
set GITVERSION_REV=.