Created
May 10, 2012 19:45
-
-
Save cjohansen/2655403 to your computer and use it in GitHub Desktop.
Run the Buster.JS server with a Phantom.JS client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on work by Tiago Rodrigues | |
# Here: http://trodrigues.net/presentations/buster-ci/#/24 | |
# And here: https://gist.github.com/2630210 | |
# Usage: | |
# env BUSTER_HOME=/where/you/installed/buster ./buster-server.sh start|stop | |
function buster_server_pid(){ | |
echo `ps aux|grep buster-server|grep node|awk '{ print $2 }'` | |
} | |
function phantom_server_pid(){ | |
echo `ps aux|grep phantomjs|grep buster|awk '{ print $2 }'` | |
} | |
case "$1" in | |
"start") | |
$BUSTER_HOME/bin/buster-server & # fork to a subshell | |
sleep 4 # takes a while for buster server to start | |
phantomjs $BUSTER_HOME/script/phantom.js & | |
echo "Started Buster.JS server with Phantom.JS client" | |
;; | |
"stop") | |
kill `buster_server_pid` | |
kill `phantom_server_pid` | |
echo "Killed Buster.JS server and Phantom.JS client" | |
;; | |
*) | |
echo "Usage: | |
$0 start|stop" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment