Skip to content

Commit

Permalink
Skip building Windows nightlies if there are no new commits
Browse files Browse the repository at this point in the history
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 sqlitebrowser#1917.
  • Loading branch information
karim committed Jun 17, 2019
1 parent dda70d9 commit e26d323
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions installer/windows/nightly_build_scripts/win32build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
17 changes: 17 additions & 0 deletions installer/windows/nightly_build_scripts/win64build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e26d323

Please sign in to comment.