Skip to content

Instantly share code, notes, and snippets.

@sue445
Created December 1, 2014 16:15
Show Gist options
  • Save sue445/9ff268d6feb3d5249799 to your computer and use it in GitHub Desktop.
Save sue445/9ff268d6feb3d5249799 to your computer and use it in GitHub Desktop.
matrix test script file for paraduct (https://github.com/sue445/paraduct)
script: |-
./script/build_for_jenkins.sh
work_dir: tmp/paraduct_workspace
variables:
gemfile:
- rails4_0.gemfile
- rails4_1.gemfile
max_threads: 4
rsync_option:
exclude_from: .paraduct_rsync_exclude.txt
.git/
tmp/
log/
vendor/bundle/
#!/bin/bash -xe
export LANG=ja_JP.UTF-8
if [ -n "${GEMFILE}" ]; then
export BUNDLE_GEMFILE=gemfiles/${GEMFILE}
echo "use ${BUNDLE_GEMFILE}"
fi
cp config/database.yml.jenkins config/database.yml
which ruby
ruby --version
gem install bundler --no-ri --no-rdoc --conservative
#########################
# bundle install失敗したら自動的にbundle updateしたいので一時的に+eする
set +e
bundle install --path vendor/bundle
RET=$?
if [ $RET -ne 0 ]; then
# if failed 'bundle install', run 'bundle update'
bundle update
fi
set -e
rm -f log/*.log
rm -rf reports
mkdir -m 777 reports/
RAILS_ENV=test bundle exec rake db:migrate:reset
RAILS_ENV=test bundle exec rspec
exit 0
default: &default
adapter: mysql2
encoding: utf8
database: example_test_<%= ENV["JOB_NAME"] %>_<%= ENV["PARADUCT_JOB_ID"] %>
pool: 20
username: root
password: 0nly0ne
socket: /var/run/mysqld/mysqld.sock
test: &test
<<: *default
#!/bin/bash -xe
gem install paraduct
paraduct test
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment