Skip to content

Instantly share code, notes, and snippets.

@lucassus
Created August 4, 2011 09:03
Show Gist options
  • Save lucassus/1124769 to your computer and use it in GitHub Desktop.
Save lucassus/1124769 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p180$ cat xvfb
#!/bin/bash
XVFB=/usr/bin/Xvfb
XVFBARGS="$DISPLAY -ac -screen 0 1024x768x16"
PIDFILE=/tmp/xvfb_${DISPLAY}.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
echo -n "Stopping virtual X frame buffer: Xvfb"
/sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
echo "."
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
exit 1
esac
exit 0
{~/Projects/rwiki/script}-{@master}-{11:02}
ruby-1.9.2-p180$ cat build_cucumber
#!/bin/bash
source ~/.bashrc
git remote prune origin
git gc
# delete old coverage reports
rm -rf coverage
rm -f features/reports/*.xml
rm -f features/reports/screenshots/*.png
rvm use 1.9.2
bundle install --path vendor/bundle
bundle exec smart_asset
# start cucumber on Xvfb
export DISPLAY=:91
script/xvfb start
bundle exec cucumber features --format Cucumber::Formatter::Junit --out features/reports --format pretty
RESULT=$?
script/xvfb stop
exit $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment