jam-cloud/build

57 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-11-18 07:56:50 +00:00
#!/bin/bash
echo "updating dependencies"
2012-12-06 12:50:01 +00:00
bundle update
if [ "$?" = "0" ]; then
echo "success: updated dependencies"
else
echo "could not update dependencies"
exit 1
fi
2012-11-18 07:56:50 +00:00
echo "running rspec tests"
bundle exec rspec
if [ "$?" = "0" ]; then
echo "success: ran rspec tests"
else
echo "running rspec tests failed."
exit 1
fi
2012-11-18 07:56:50 +00:00
echo "running jasmine tests"
#http://shortforgilbert.com/blog/2011/03/25/headless-jasmine-ci
# TODO starting Xvfb here because we don't do this on start of build server
# If you run it once, it will background/nohup itself, so this is 'lazy'
Xvfb :99 -screen 0 1440x900x16 > /dev/null 2>&1 &
# run jasmine using the virtual screen, and in the test environment to use the jam_web_test db
DISPLAY=":99" rake jasmine:ci RAILS_ENV=test
2012-11-18 07:56:50 +00:00
if [ "$?" = "0" ]; then
echo "success: jasmine tests completed"
2012-11-18 07:56:50 +00:00
else
echo "running jasmine tests failed"
2012-11-18 07:56:50 +00:00
exit 1
fi
echo "running cucumber tests"
DISPLAY=":99" bundle exec cucumber
if [ "$?" = "0" ]; then
echo "success: cucumber tests completed"
else
echo "running cucumber tests failed"
exit 1
fi
2012-12-29 16:12:05 +00:00
if [ -n "$PACKAGE" ]; then
# cache all gems local, and tell bundle to use local gems only
DIR=.
bundle install --path vendor/bundle --local
bundle exec fpm -s dir -t deb -n "jam-web" -v "0.1.$BUILD_NUMBER" . --post-install $DIR/script/package/post-install.sh --pre-install $DIR/script/package/pre-install.sh --pre-uninstall $DIR/script/package/pre-uninstall.sh --post-uninstall $DIR/script/package/post-install.sh
2012-12-29 16:12:05 +00:00
fi
2012-11-18 07:56:50 +00:00
echo "build complete"