-
-
Save jimjh/5904659 to your computer and use it in GitHub Desktop.
Jenkins script for Karma+Cloudbees
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/sh | |
# install nodejs, if using cloudbees | |
curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node | |
NODE_VERSION=0.11.1 source ./use-node | |
# install phantomjs, karma | |
[ -d node_modules/phantomjs ] || npm install phantomjs | |
[ -d node_modules/karma ] || npm install karma | |
# install bundler and gems | |
echo "install: --no-document" > ~/.gemrc | |
echo "update: --no-document" >> ~/.gemrc | |
gem install --conservative bundler | |
bundle check || bundle install | |
# load database schema | |
bundle exec rake db:schema:load | |
bundle exec rake db:test:prepare | |
export PHANTOMJS_BIN='node_modules/phantomjs/bin/phantomjs' | |
# run | |
# bundle exec rspec --format CI::Repo | |
node_modules/karma/bin/karma start --browsers PhantomJS config/karma.conf.js |
To answer my own question: add "thin" web server to the bundle and then:
bundle exec thin --rackup config.ru --port NNNN --daemonize start
# karma start here
bundle exec thin stop
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like you prep your Rails environment with bundle & rake db:migrate, but how do you start the Rails server?