]> source.dussan.org Git - sonarqube.git/commitdiff
Cancel the Travis build of a branch when a pull request exists
authorTom <thomas.verin@sonarsource.com>
Thu, 20 Apr 2017 07:47:11 +0000 (09:47 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 4 May 2017 11:49:28 +0000 (13:49 +0200)
It allows to not use slaves for nothing by executing twice
(more or less) the same job. Building the pull request
is enough in most cases.

travis.sh

index d2bb0abb6bbad7d0b3986ad224e91822b6c1c94c..97963c503ccadfc812e112f61b95c6a12d5bc6cd 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -113,11 +113,16 @@ function fixBuildVersion {
 #
 function configureTravis {
   mkdir ~/.local
-  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v33 | tar zx --strip-components 1 -C ~/.local
+  curl -sSL https://github.com/SonarSource/travis-utils/tarball/v35 | 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.
+# @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
+cancel_branch_build_with_pr
+
 case "$TARGET" in
 
 BUILD)