Skip to content

Instantly share code, notes, and snippets.

@jaikoo
Created February 9, 2012 13:58
Show Gist options
  • Save jaikoo/1780144 to your computer and use it in GitHub Desktop.
Save jaikoo/1780144 to your computer and use it in GitHub Desktop.
Jenkins - Build - Execute Shell
#!/bin/bash
read -d '' database_yml <<"EOF"
login: &login
adapter: mysql2
host: localhost
username: root
encoding: utf8
collation: utf8_general_ci
test: &test
database: your_db_name
<<: *login
EOF
echo "$database_yml" > config/database.yml
source "/usr/local/rvm/scripts/rvm"
rvm use 1.9.3
export RAILS_ENV=test
bundle
rake db:create
rake db:migrate
rake db:test:prepare
rake spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment