Mercurial > hg > soundsoftware-site
comparison lib/tasks/ci.rake @ 1516:b450a9d58aed redmine-2.4
Update to Redmine SVN revision 13356 on 2.4-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:28:31 +0100 |
parents | 261b3d9a4903 |
children | dffacf8a6908 |
comparison
equal
deleted
inserted
replaced
1494:e248c7af89ec | 1516:b450a9d58aed |
---|---|
1 desc "Run the Continous Integration tests for Redmine" | 1 desc "Run the Continuous Integration tests for Redmine" |
2 task :ci do | 2 task :ci do |
3 # RAILS_ENV and ENV[] can diverge so force them both to test | 3 # RAILS_ENV and ENV[] can diverge so force them both to test |
4 ENV['RAILS_ENV'] = 'test' | 4 ENV['RAILS_ENV'] = 'test' |
5 RAILS_ENV = 'test' | 5 RAILS_ENV = 'test' |
6 Rake::Task["ci:setup"].invoke | 6 Rake::Task["ci:setup"].invoke |
14 Rake::Task["tmp:clear"].invoke | 14 Rake::Task["tmp:clear"].invoke |
15 Rake::Task["log:clear"].invoke | 15 Rake::Task["log:clear"].invoke |
16 Rake::Task["db:create:all"].invoke | 16 Rake::Task["db:create:all"].invoke |
17 Rake::Task["db:migrate"].invoke | 17 Rake::Task["db:migrate"].invoke |
18 Rake::Task["db:schema:dump"].invoke | 18 Rake::Task["db:schema:dump"].invoke |
19 Rake::Task["test:scm:setup:all"].invoke | 19 if scms = ENV['SCMS'] |
20 scms.split(',').each do |scm| | |
21 Rake::Task["test:scm:setup:#{scm}"].invoke | |
22 end | |
23 else | |
24 Rake::Task["test:scm:setup:all"].invoke | |
25 end | |
20 Rake::Task["test:scm:update"].invoke | 26 Rake::Task["test:scm:update"].invoke |
21 end | 27 end |
22 | 28 |
23 desc "Build Redmine" | 29 desc "Build Redmine" |
24 task :build do | 30 task :build do |
25 Rake::Task["test"].invoke | 31 if test_suite = ENV['TEST_SUITE'] |
32 Rake::Task["test:#{test_suite}"].invoke | |
33 else | |
34 Rake::Task["test"].invoke | |
35 end | |
26 # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3' | 36 # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3' |
27 end | 37 end |
28 | 38 |
29 desc "Finish the build" | 39 desc "Finish the build" |
30 task :teardown do | 40 task :teardown do |
41 test_db_name = "ci_#{branch}_#{ruby}_test" | 51 test_db_name = "ci_#{branch}_#{ruby}_test" |
42 | 52 |
43 case database | 53 case database |
44 when 'mysql' | 54 when 'mysql' |
45 dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), | 55 dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), |
46 'database' => dev_db_name, 'host' => 'localhost', | 56 'database' => dev_db_name, 'host' => 'localhost', |
47 'username' => 'jenkins', 'password' => 'jenkins', | 57 'encoding' => 'utf8'} |
48 'encoding' => 'utf8'} | 58 if ENV['RUN_ON_NOT_OFFICIAL'] |
59 dev_conf['username'] = 'root' | |
60 else | |
61 dev_conf['username'] = 'jenkins' | |
62 dev_conf['password'] = 'jenkins' | |
63 end | |
49 test_conf = dev_conf.merge('database' => test_db_name) | 64 test_conf = dev_conf.merge('database' => test_db_name) |
50 when 'postgresql' | 65 when 'postgresql' |
51 dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, | 66 dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, |
52 'host' => 'localhost', | 67 'host' => 'localhost'} |
53 'username' => 'jenkins', 'password' => 'jenkins'} | 68 if ENV['RUN_ON_NOT_OFFICIAL'] |
69 dev_conf['username'] = 'postgres' | |
70 else | |
71 dev_conf['username'] = 'jenkins' | |
72 dev_conf['password'] = 'jenkins' | |
73 end | |
54 test_conf = dev_conf.merge('database' => test_db_name) | 74 test_conf = dev_conf.merge('database' => test_db_name) |
55 when /sqlite3/ | 75 when /sqlite3/ |
56 dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? | 76 dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? |
57 'jdbcsqlite3' : 'sqlite3'), | 77 'jdbcsqlite3' : 'sqlite3'), |
58 'database' => "db/#{dev_db_name}.sqlite3"} | 78 'database' => "db/#{dev_db_name}.sqlite3"} |