##// END OF EJS Templates
add "tmp:clear" to "ci:setup" rake task for new translation...
Toshi MARUYAMA -
r11159:52d15dd122d0
parent child
Show More
@@ -1,62 +1,63
1 1 desc "Run the Continous Integration tests for Redmine"
2 2 task :ci do
3 3 # RAILS_ENV and ENV[] can diverge so force them both to test
4 4 ENV['RAILS_ENV'] = 'test'
5 5 RAILS_ENV = 'test'
6 6 Rake::Task["ci:setup"].invoke
7 7 Rake::Task["ci:build"].invoke
8 8 Rake::Task["ci:teardown"].invoke
9 9 end
10 10
11 11 namespace :ci do
12 12 desc "Setup Redmine for a new build"
13 13 task :setup do
14 Rake::Task["tmp:clear"].invoke
14 15 Rake::Task["log:clear"].invoke
15 16 Rake::Task["db:create:all"].invoke
16 17 Rake::Task["db:migrate"].invoke
17 18 Rake::Task["db:schema:dump"].invoke
18 19 Rake::Task["test:scm:setup:all"].invoke
19 20 Rake::Task["test:scm:update"].invoke
20 21 end
21 22
22 23 desc "Build Redmine"
23 24 task :build do
24 25 Rake::Task["test"].invoke
25 26 #Rake::Task["test:ui"].invoke unless RUBY_VERSION < '1.9'
26 27 end
27 28
28 29 desc "Finish the build"
29 30 task :teardown do
30 31 end
31 32 end
32 33
33 34 desc "Creates database.yml for the CI server"
34 35 file 'config/database.yml' do
35 36 require 'yaml'
36 37 database = ENV['DATABASE_ADAPTER']
37 38 ruby = ENV['RUBY_VER'].gsub('.', '').gsub('-', '')
38 39 branch = ENV['BRANCH'].gsub('.', '').gsub('-', '')
39 40 dev_db_name = "ci_#{branch}_#{ruby}_dev"
40 41 test_db_name = "ci_#{branch}_#{ruby}_test"
41 42
42 43 case database
43 44 when 'mysql'
44 45 dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), 'database' => dev_db_name, 'host' => 'localhost', 'username' => 'jenkins', 'password' => 'jenkins', 'encoding' => 'utf8'}
45 46 test_conf = dev_conf.merge('database' => test_db_name)
46 47 when 'postgresql'
47 48 dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, 'host' => 'localhost', 'username' => 'jenkins', 'password' => 'jenkins'}
48 49 test_conf = dev_conf.merge('database' => test_db_name)
49 50 when 'sqlite3'
50 51 dev_conf = {'adapter' => 'sqlite3', 'database' => "db/#{dev_db_name}.sqlite3"}
51 52 test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
52 53 when 'sqlserver'
53 54 dev_conf = {'adapter' => 'sqlserver', 'database' => dev_db_name, 'host' => 'mssqlserver', 'port' => 1433, 'username' => 'jenkins', 'password' => 'jenkins'}
54 55 test_conf = dev_conf.merge('database' => test_db_name)
55 56 else
56 57 abort "Unknown database"
57 58 end
58 59
59 60 File.open('config/database.yml', 'w') do |f|
60 61 f.write YAML.dump({'development' => dev_conf, 'test' => test_conf})
61 62 end
62 63 end
General Comments 0
You need to be logged in to leave comments. Login now