Skip to content

Instantly share code, notes, and snippets.

@johnnywey
Forked from cjohansen/buster-server.sh
Created July 5, 2012 21:53
Show Gist options
  • Save johnnywey/3056727 to your computer and use it in GitHub Desktop.
Save johnnywey/3056727 to your computer and use it in GitHub Desktop.
Run the Buster.JS server with a Phantom.JS client
#!/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 "http://localhost:1111/capture" &
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
@johnnywey
Copy link
Author

Fixed capture URL in script. This is fixed in the buster master but not yet in the buster official beta.

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