Skip to content

Instantly share code, notes, and snippets.

@minad
Last active August 25, 2020 20:07
Show Gist options
  • Select an option

  • Save minad/4459041 to your computer and use it in GitHub Desktop.

Select an option

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

patcon commented Mar 7, 2013

Copy link
Copy Markdown

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

minad commented Mar 7, 2013

Copy link
Copy Markdown
Author

:)

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