ChiliProject on Travis <3 <3 <3
This commit is contained in:
parent
75bb38df08
commit
03dfae0529
|
@ -0,0 +1,25 @@
|
|||
language: ruby
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 1.9.2
|
||||
- 1.9.3
|
||||
env:
|
||||
- "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
||||
- "RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
|
||||
- "RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
|
||||
- "RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
|
||||
matrix:
|
||||
exclude:
|
||||
- rvm: 1.9.2
|
||||
env: "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
||||
- rvm: 1.9.3
|
||||
env: "RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
||||
before_script:
|
||||
- "sudo apt-get -qq update"
|
||||
- "sudo apt-get -qq --no-install-recommends install bzr cvs darcs git mercurial subversion"
|
||||
- "rake ci:travis:prepare"
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
notifications:
|
||||
email: false
|
2
Gemfile
2
Gemfile
|
@ -15,6 +15,8 @@ gem "tzinfo", "~> 0.3.31" # Fixes #903. Not required for Rails >= 3.2
|
|||
|
||||
group :test do
|
||||
gem 'shoulda', '~> 2.10.3'
|
||||
# Shoulda doesn't work nice on 1.9.3 and seems to need test-unit explicitely…
|
||||
gem 'test-unit', :platforms => [:mri_19]
|
||||
gem 'edavis10-object_daddy', :require => 'object_daddy'
|
||||
gem 'mocha'
|
||||
gem 'capybara'
|
||||
|
|
|
@ -24,6 +24,41 @@ end
|
|||
|
||||
# Tasks can be hooked into by redefining them in a plugin
|
||||
namespace :ci do
|
||||
namespace :travis do
|
||||
desc "Prepare a TRAVIS run"
|
||||
task :prepare do
|
||||
ENV['RAILS_ENV'] = 'test'
|
||||
RAILS_ENV = 'test'
|
||||
|
||||
database_yml = {"database" => "chiliproject_test"}
|
||||
database_yml.merge! case ENV['DB']
|
||||
when 'mysql'
|
||||
{"adapter" => "mysql", "username" => "root"}
|
||||
when 'mysql2'
|
||||
{"adapter" => "mysql2", "username" => "root"}
|
||||
when 'postgres'
|
||||
{"adapter" => "postgresql", "username" => "postgres"}
|
||||
when 'sqlite'
|
||||
{"adapter" => "sqlite3", "database" => "db/test.sqlite3"}
|
||||
end
|
||||
|
||||
File.open("config/database.yml", 'w') do |f|
|
||||
YAML.dump({"test" => database_yml}, f)
|
||||
end
|
||||
|
||||
Rake::Task["generate_session_store"].invoke
|
||||
|
||||
# Create and migrate the database
|
||||
Rake::Task["db:create"].invoke
|
||||
Rake::Task["db:migrate"].invoke
|
||||
Rake::Task["db:migrate:plugins"].invoke
|
||||
Rake::Task["db:schema:dump"].invoke
|
||||
|
||||
# Create test repositories
|
||||
Rake::Task["test:scm:setup:all"].invoke
|
||||
end
|
||||
end
|
||||
|
||||
desc "Setup Redmine for a new build."
|
||||
task :setup do
|
||||
Rake::Task["ci:dump_environment"].invoke
|
||||
|
|
Loading…
Reference in New Issue