summaryrefslogtreecommitdiff
path: root/script/cibuild.sh
diff options
context:
space:
mode:
authorTony Kelman <tony@kelman.net>2015-03-03 21:07:12 -0800
committerTony Kelman <tony@kelman.net>2015-03-04 11:29:44 -0800
commitba6c53b91b1d9c9dc49b7c0d8e8efbd9842c31dc (patch)
tree5953214bf2a5ba710ddf33169ce8d83e5ad2824b /script/cibuild.sh
parent8008ab6a4158416d095212c9782fa1622ef994a5 (diff)
downloadlibgit2-ba6c53b91b1d9c9dc49b7c0d8e8efbd9842c31dc.tar.gz
Implement fail-fast for Travis as well
Diffstat (limited to 'script/cibuild.sh')
-rwxr-xr-xscript/cibuild.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/cibuild.sh b/script/cibuild.sh
index 8983dcce0..82cf72553 100755
--- a/script/cibuild.sh
+++ b/script/cibuild.sh
@@ -1,5 +1,15 @@
#!/bin/sh
+# Fail fast for superseded builds to PR's
+if ! [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
+ if ! [ \"$TRAVIS_BUILD_NUMBER\" = $(curl -H "Accept: application/vnd.travis-ci.2+json" \
+ https://api.travis-ci.org/repos/libgit2/libgit2/builds?event_type=pull_request | \
+ jq ".builds | map(select(.pull_request_number == $TRAVIS_PULL_REQUEST))[0].number") ]; then
+ echo "There are newer queued builds for this pull request, failing early."
+ exit 1
+ fi
+fi
+
if [ -n "$COVERITY" ];
then
./script/coverity.sh;