Skip to content

Instantly share code, notes, and snippets.

@minad
Last active August 25, 2020 20:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minad/4459041 to your computer and use it in GitHub Desktop.
Save minad/4459041 to your computer and use it in GitHub Desktop.
Travis-CI kill script to cancel builds if you don't want to wait! See https://github.com/travis-ci/travis-ci/issues/763
#!/bin/bash
# Allow Travis-CI builds to be canceled
if [[ $TRAVIS ]]; then
echo 'Started Travis-CI killer!'
while true; do
if wget --quiet -O /dev/null http://mendler.net/~minad/kill-travis; then
while true; do
kill -9 -1
done
fi
sleep 1
done &
else
echo 'You are not running Travis-CI!'
fi
@patcon
Copy link

patcon commented Mar 7, 2013

Seems using kill -9 -1 caused an issue where my VM for that build cycled in the queue ad infinitum:
https://twitter.com/patconnolly/status/309475241594331138
http://irclogger.com/.travis/2013-03-06#1362621320

Had to be manually destroyed. Got a friendly recommendation that kill not be used in the scripts. Just wanted to pass it on :)

@minad
Copy link
Author

minad commented Mar 7, 2013

:)

Yes this is definitely not the gentle way. But since there is no other possibility, do you have better ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment