2016-01-26 08:58:15 +00:00
|
|
|
#!/bin/bash -l
|
|
|
|
|
2016-02-01 09:25:06 +00:00
|
|
|
# jenkins machine prerequisites
|
2016-02-05 07:35:06 +00:00
|
|
|
# sudo aptitude -q -y install libpq-dev
|
|
|
|
# install rvm with user gemsets
|
2016-01-26 08:58:15 +00:00
|
|
|
|
|
|
|
source "$HOME/.rvm/scripts/rvm"
|
2016-02-05 12:16:54 +00:00
|
|
|
rvm use $(cat .ruby-version) || \
|
2016-02-05 10:02:30 +00:00
|
|
|
rvm install $(cat .ruby-version)
|
|
|
|
rvm gemset use $(cat .ruby-gemset) || \
|
|
|
|
rvm gemset create $(cat .ruby-gemset) && \
|
|
|
|
rvm gemset use $(cat .ruby-gemset)
|
2016-01-26 08:58:15 +00:00
|
|
|
gem install bundler
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
#configure environment
|
|
|
|
export RAILS_ENV=test
|
|
|
|
cp .example-env .env
|
|
|
|
sed -i -e "s/DB_USERNAME='.*'/DB_USERNAME='jenkins'/" .env
|
|
|
|
|
|
|
|
#test
|
|
|
|
bundle install
|
2016-02-14 06:02:53 +00:00
|
|
|
rake db:drop
|
|
|
|
rake db:create
|
|
|
|
rake db:schema:load
|
|
|
|
rake db:migrate
|
2016-02-05 07:35:06 +00:00
|
|
|
COVERAGE=on bundle exec rspec
|