]> source.dussan.org Git - sonarqube.git/commitdiff
Silent cancellation of branch build on Travis if a PR is open
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 24 Nov 2017 15:28:11 +0000 (16:28 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 24 Nov 2017 15:28:11 +0000 (16:28 +0100)
travis.sh

index a001a957e22a8d7f9aab97599e3ec74c96ef77fa..58733b3f1a4b1d12e1b461fde7d487ec60f18785 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -105,15 +105,16 @@ function fixBuildVersion {
 #
 function configureTravis {
   mkdir -p ~/.local
-  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v38 | tar zx --strip-components 1 -C ~/.local
+  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v41 | tar zx --strip-components 1 -C ~/.local
   source ~/.local/bin/install
 }
 configureTravis
 
-# When pull request exists on the branch, then the job related to the branch does not need
-# to be executed and should be canceled. It does not book slaves for nothing.
+# When a pull request is open on the branch, then the job related
+# to the branch does not need to be executed and should be canceled.
+# It does not book slaves for nothing.
 # @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
-cancel_branch_build_with_pr
+cancel_branch_build_with_pr || if [[ $? -eq 1 ]]; then exit 0; fi
 
 case "$TARGET" in