Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created May 24, 2013 08:44
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 dave1010/5642165 to your computer and use it in GitHub Desktop.
Save dave1010/5642165 to your computer and use it in GitHub Desktop.
Run unit tests whenever a file changes - a very basic CI server
#!/bin/bash
# watches for modified files in current directory (".") and "../src"
# runs phpunit when things change
# also requires inotify-tools
# make by dave1010. WTFPL
# future:
# * just use a real CI server
# * better email notifications
# * run on git post-receive hook
while true; do inotifywait -r -e modify ../src . && phpunit; done
# want email notifications when it fails?
# while true; do inotifywait -r -e modify ../src . && phpunit || echo "fail"|mail -s "test fail" me@example.com; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment