aboutsummaryrefslogtreecommitdiffstats
path: root/travis.sh
diff options
context:
space:
mode:
authorTom <thomas.verin@sonarsource.com>2017-04-20 09:47:11 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-05-04 13:49:28 +0200
commit02cc6c36d46f4b50781b750cdae286fd28dd0979 (patch)
tree7fc840618fc703ab1d8a0bcf1e68f13adb5626cd /travis.sh
parente10f04d5b4055e2813ac01a811b325a414797c4e (diff)
downloadsonarqube-02cc6c36d46f4b50781b750cdae286fd28dd0979.tar.gz
sonarqube-02cc6c36d46f4b50781b750cdae286fd28dd0979.zip
Cancel the Travis build of a branch when a pull request exists
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.
Diffstat (limited to 'travis.sh')
-rwxr-xr-xtravis.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/travis.sh b/travis.sh
index d2bb0abb6bb..97963c503cc 100755
--- 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)