Skip building Windows nightlies if there are no new commits

Windows build script will now save, and check, the last build commit and
skip building if there are no new commits since the last automatic build.

See #1917.
This commit is contained in:
Karim ElDeeb
2019-06-17 23:45:00 +02:00
parent dda70d903e
commit e26d32364e
2 changed files with 34 additions and 0 deletions
@@ -47,6 +47,19 @@ git pull
git clean -dffx
:: Get the current commit hash
FOR /F %%A IN ('git rev-parse --verify HEAD') DO SET CURRENT_COMMIT=%%A
:: Get the last build commit hash from the server
curl -f -L -o commit.txt "https://nightlies.sqlitebrowser.org/win32/commit.txt"
:: Save the hash to a variable for comparison
IF EXIST "commit.txt" SET /P LAST_COMMIT=<commit.txt
:: Do not continue if there are no changes
IF "%CURRENT_COMMIT%"=="%LAST_COMMIT%" EXIT
:: WIN32 SQLITE BUILD PROCEDURE
:: Set path variables
@@ -112,6 +125,10 @@ MOVE %CD%\zip\System\* "%CD%\zip\DB Browser for SQLite"
RMDIR /S /Q %CD%\zip
:: Save the last commit hash to 'commit.txt' and upload it to the nightlies server
git rev-parse --verify HEAD 1>commit.txt
pscp -q -p -i C:\dev\puttygen_private.ppk "%DEST_PATH%\commit.txt" nightlies@nightlies.sqlitebrowser.org:/nightlies/win32
:: Upload the packages to the nightlies server
pscp -q -p -i C:\dev\puttygen_private.ppk "%DEST_PATH%\DB*%RUN_DATE%*win32.*" nightlies@nightlies.sqlitebrowser.org:/nightlies/win32
@@ -47,6 +47,19 @@ git pull
git clean -dffx
:: Get the current commit hash
FOR /F %%A IN ('git rev-parse --verify HEAD') DO SET CURRENT_COMMIT=%%A
:: Get the last build commit hash from the server
curl -f -L -o commit.txt "https://nightlies.sqlitebrowser.org/win64/commit.txt"
:: Save the hash to a variable for comparison
IF EXIST "commit.txt" SET /P LAST_COMMIT=<commit.txt
:: Do not continue if there are no changes
IF "%CURRENT_COMMIT%"=="%LAST_COMMIT%" EXIT
:: WIN64 SQLITE BUILD PROCEDURE
:: Set path variables
@@ -112,6 +125,10 @@ MOVE %CD%\zip\System64\* "%CD%\zip\DB Browser for SQLite"
RMDIR /S /Q %CD%\zip
:: Save the last commit hash to 'commit.txt' and upload it to the nightlies server
git rev-parse --verify HEAD 1>commit.txt
pscp -q -p -i C:\dev\puttygen_private.ppk "%DEST_PATH%\commit.txt" nightlies@nightlies.sqlitebrowser.org:/nightlies/win64
:: Upload the packages to the nightlies server
pscp -q -p -i C:\dev\puttygen_private.ppk "%DEST_PATH%\DB*%RUN_DATE%*win64.*" nightlies@nightlies.sqlitebrowser.org:/nightlies/win64