Skip to content
Browse files

create MySQL database for Travis CI

  • Loading branch information...
1 parent 33aec7a commit ced692d81d9e35ff7dd87f41427a52aa1ae6d121 @henning-koch henning-koch committed Dec 11, 2012
Showing with 24 additions and 0 deletions.
  1. +3 −0 .travis.yml
  2. +21 −0 Rakefile
View
3 .travis.yml
@@ -3,6 +3,9 @@ rvm:
- "1.8.7"
- "1.9.3"
- ree
+services:
+ - mysql
+before_script: rake travis_ci:prepare
script: rake all:bundle all:spec
notifications:
email:
View
21 Rakefile
@@ -4,6 +4,27 @@ require 'bundler/gem_tasks'
desc 'Default: Run all specs.'
task :default => 'all:spec'
+namespace :travis_ci do
+
+ desc 'Things to do before Travis CI begins'
+ task :prepare do
+ Rake::Task['travis_ci:create_database'].invoke &&
+ Rake::Task['travis_ci:create_database_yml'].invoke
+ end
+
+ desc 'Creates a test database'
+ task :create_database do
+ system("mysql -e 'create database dusen_test;'")
+ end
+
+ desc 'Creates a database.yml'
+ task :create_database_yml do
+ config_dir = "spec/shared/app_root/config"
+ system("cp #{config_dir}/database.sample.yml #{config_dir}/database.yml")
+ end
+
+end
+
namespace :all do
desc "Run specs on all spec apps"

0 comments on commit ced692d

Please sign in to comment.
Something went wrong with that request. Please try again.