##// END OF EJS Templates
Pass the commit keyword used to update the issue to the plugin hook....
Pass the commit keyword used to update the issue to the plugin hook. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12198 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r11749:9bf4288af9e5
r11968:0444ecca3c87
Show More
ci.rake
63 lines | 2.2 KiB | text/x-ruby | RubyLexer
Eric Davis
Add a rake task to run CI....
r3805 desc "Run the Continous Integration tests for Redmine"
task :ci do
# RAILS_ENV and ENV[] can diverge so force them both to test
ENV['RAILS_ENV'] = 'test'
RAILS_ENV = 'test'
Rake::Task["ci:setup"].invoke
Rake::Task["ci:build"].invoke
Rake::Task["ci:teardown"].invoke
end
namespace :ci do
Jean-Philippe Lang
CI tasks cleanup....
r11053 desc "Setup Redmine for a new build"
Eric Davis
Add a rake task to run CI....
r3805 task :setup do
Toshi MARUYAMA
add "tmp:clear" to "ci:setup" rake task for new translation...
r11159 Rake::Task["tmp:clear"].invoke
Jean-Philippe Lang
CI tasks cleanup....
r11053 Rake::Task["log:clear"].invoke
Jean-Philippe Lang
Create all databases....
r11093 Rake::Task["db:create:all"].invoke
Eric Davis
Add a rake task to run CI....
r3805 Rake::Task["db:migrate"].invoke
Rake::Task["db:schema:dump"].invoke
Jean-Philippe Lang
CI tasks cleanup....
r11053 Rake::Task["test:scm:setup:all"].invoke
Jean-Philippe Lang
Adds a rake task test:scm:update to update test repositories if needed....
r4523 Rake::Task["test:scm:update"].invoke
Eric Davis
Add a rake task to run CI....
r3805 end
desc "Build Redmine"
task :build do
Rake::Task["test"].invoke
Toshi MARUYAMA
not run Capybara tests on the CI server (#12822)...
r11749 # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3'
Eric Davis
Add a rake task to run CI....
r3805 end
desc "Finish the build"
task :teardown do
end
Jean-Philippe Lang
CI tasks cleanup....
r11053 end
Eric Davis
Add a rake task to run CI....
r3805
Jean-Philippe Lang
CI tasks cleanup....
r11053 desc "Creates database.yml for the CI server"
file 'config/database.yml' do
require 'yaml'
database = ENV['DATABASE_ADAPTER']
ruby = ENV['RUBY_VER'].gsub('.', '').gsub('-', '')
branch = ENV['BRANCH'].gsub('.', '').gsub('-', '')
dev_db_name = "ci_#{branch}_#{ruby}_dev"
test_db_name = "ci_#{branch}_#{ruby}_test"
case database
when 'mysql'
dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), 'database' => dev_db_name, 'host' => 'localhost', 'username' => 'jenkins', 'password' => 'jenkins', 'encoding' => 'utf8'}
test_conf = dev_conf.merge('database' => test_db_name)
when 'postgresql'
dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, 'host' => 'localhost', 'username' => 'jenkins', 'password' => 'jenkins'}
test_conf = dev_conf.merge('database' => test_db_name)
when 'sqlite3'
dev_conf = {'adapter' => 'sqlite3', 'database' => "db/#{dev_db_name}.sqlite3"}
test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
when 'sqlserver'
dev_conf = {'adapter' => 'sqlserver', 'database' => dev_db_name, 'host' => 'mssqlserver', 'port' => 1433, 'username' => 'jenkins', 'password' => 'jenkins'}
test_conf = dev_conf.merge('database' => test_db_name)
else
abort "Unknown database"
Jean-Philippe Lang
Adds a quick and dirty task for creating databases on the CI server....
r9201 end
Jean-Philippe Lang
CI tasks cleanup....
r11053 File.open('config/database.yml', 'w') do |f|
f.write YAML.dump({'development' => dev_conf, 'test' => test_conf})
Eric Davis
Add a rake task to run CI....
r3805 end
end