Skip to content

Instantly share code, notes, and snippets.

@joxxoxo
Last active December 18, 2015 12:10
Show Gist options
  • Save joxxoxo/5781181 to your computer and use it in GitHub Desktop.
Save joxxoxo/5781181 to your computer and use it in GitHub Desktop.
jenkins_example
#!/bin/bash -x
source /var/lib/jenkins/.bash_profile
source /var/lib/jenkins/.bashrc
rvm use 1.9.3-p194-railsexpress@qwerty --create
bundle install
read -d '' database_yml <<"EOF"
login: &login
adapter: mysql2
username: "foo"
password: "bar"
encoding: utf8
test: &test
database: qwerty_jenkins_test
<<: *login
EOF
echo "$database_yml" > config/database.yml
bundle exec rake db:drop db:create RAILS_ENV=test
bundle exec rake db:structure:load RAILS_ENV=test
bundle exec rake db:migrate RAILS_ENV=test
bundle exec rake ci:setup:rspec spec RAILS_ENV=test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment