]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix continuous integration of pull requests
authorDRC <information@libjpeg-turbo.org>
Fri, 23 Mar 2018 18:57:59 +0000 (13:57 -0500)
committerDRC <information@libjpeg-turbo.org>
Fri, 23 Mar 2018 20:00:09 +0000 (15:00 -0500)
- Travis doesn't set the $encrypted_* variables for PRs, so disable GPG
signing when building a PR (artifacts aren't deployed for PRs anyhow,
and even if they were, I wouldn't want them to be signed, as they may
contain unvetted code.)
- Take advantage of the new -d option in buildljt, which allows for
building from an existing Git clone directory.  This eliminates the need
to rename and restore .git/shallow, allows the official build scripts to
work properly when building PRs, and prevents 'git clone' being invoked
twice in CI builds.

Refer to #217

.travis.yml
appveyor.yml

index 4e10a46afdd967c851432fe6ab0fe234e1871ac0..3245ab55c3fe8b2c63c1cb95791affe6bb858e56 100644 (file)
@@ -54,30 +54,26 @@ before_install:
         docker pull dcommander/buildljt;
       fi &&
       git clone --depth=1 https://github.com/libjpeg-turbo/buildscripts.git -b $TRAVIS_BRANCH ~/src/buildscripts &&
-      openssl aes-256-cbc -K $encrypted_f92e8533f6f1_key -iv $encrypted_f92e8533f6f1_iv -in ci/keys.enc -out ci/keys -d &&
-      tar xf ci/keys &&
-      rm ci/keys &&
-      mv ci/gpgsign ~/src/buildscripts &&
-      gpg --import ci/sign_ljt &&
-      rm ci/sign_ljt;
+      if [ -n "$encrypted_f92e8533f6f1_iv" ]; then
+        openssl aes-256-cbc -K $encrypted_f92e8533f6f1_key -iv $encrypted_f92e8533f6f1_iv -in ci/keys.enc -out ci/keys -d &&
+        tar xf ci/keys &&
+        rm ci/keys &&
+        mv ci/gpgsign ~/src/buildscripts &&
+        gpg --import ci/sign_ljt &&
+        rm ci/sign_ljt;
+      fi
     fi
 
 script:
   - if [ "${BUILD_OFFICIAL:-}" != "" ]; then
       mkdir -p ~/src/ljt.nightly &&
-      if [ -f .git/shallow ]; then
-        mv .git/shallow .git/shallow.bak;
-      fi &&
       if [ "$TRAVIS_OS_NAME" = "linux" ]; then
-        docker run -v $HOME/src/ljt.nightly:/root/src/ljt.nightly -v $HOME/src/buildscripts:/root/src/buildscripts -v $TRAVIS_BUILD_DIR:/root/src/libjpeg-turbo -v $HOME/.gnupg:/root/.gnupg -t dcommander/buildljt:latest bash -c "rpm --import http://pgp.mit.edu/pks/lookup?op=get\&search=0x0575F26BD5B3FDB1 && ~/src/buildscripts/buildljt -r file:///root/src/libjpeg-turbo $TRAVIS_BRANCH -v" &&
+        docker run -v $HOME/src/ljt.nightly:/root/src/ljt.nightly -v $HOME/src/buildscripts:/root/src/buildscripts -v $TRAVIS_BUILD_DIR:/root/src/libjpeg-turbo -v $HOME/.gnupg:/root/.gnupg -t dcommander/buildljt:latest bash -c "rpm --import http://pgp.mit.edu/pks/lookup?op=get\&search=0x0575F26BD5B3FDB1 && ~/src/buildscripts/buildljt -d /root/src/libjpeg-turbo -v" &&
         sudo chown -R travis:travis ~/src/ljt.nightly &&
         mv ~/src/ljt.nightly/latest/log-$TRAVIS_OS_NAME.txt ~/src/ljt.nightly/latest/files/;
       else
-        PATH=$PATH:~/src/gas-preprocessor ~/src/buildscripts/buildljt -r file://$TRAVIS_BUILD_DIR $TRAVIS_BRANCH -v &&
+        PATH=$PATH:~/src/gas-preprocessor ~/src/buildscripts/buildljt -d $TRAVIS_BUILD_DIR -v &&
         mv ~/src/ljt.nightly/latest/log-$TRAVIS_OS_NAME.txt ~/src/ljt.nightly/latest/files/;
-      fi &&
-      if [ -f .git/shallow.bak ]; then
-        mv .git/shallow.bak .git/shallow;
       fi
     fi
   - if [ "${BUILD_OFFICIAL:-}" == "" ]; then
index 4f2d6cc9f9d71ac2cada0e61b58106b411e25b75..450cb3a198146b3d6b5b89187baa67ca41690bff 100644 (file)
@@ -26,7 +26,7 @@ build_script:
   - cmd: >-
       for /f %%i in ('"cygpath %CD%"') do set MINGWPATH=%%i
 
-      bash c:/buildscripts/buildljt -r file://%MINGWPATH% -b /c/ljt.nightly %APPVEYOR_REPO_BRANCH% -v
+      bash c:/buildscripts/buildljt -d %MINGWPATH% -b /c/ljt.nightly -v
 
       move c:\ljt.nightly\files\*.tar.gz .