To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / lib / tasks / ci.rake @ 441:cbce1fd3b1b7

History | View | Annotate | Download (1.09 KB)

1
desc "Run the Continous Integration tests for Redmine"
2
task :ci do
3
  # RAILS_ENV and ENV[] can diverge so force them both to test
4
  ENV['RAILS_ENV'] = 'test'
5
  RAILS_ENV = 'test'
6
  Rake::Task["ci:setup"].invoke
7
  Rake::Task["ci:build"].invoke
8
  Rake::Task["ci:teardown"].invoke
9
end
10

    
11
# Tasks can be hooked into by redefining them in a plugin
12
namespace :ci do
13
  desc "Setup Redmine for a new build."
14
  task :setup do
15
    Rake::Task["ci:dump_environment"].invoke
16
    Rake::Task["db:create"].invoke
17
    Rake::Task["db:migrate"].invoke
18
    Rake::Task["db:schema:dump"].invoke
19
    Rake::Task["test:scm:update"].invoke
20
  end
21

    
22
  desc "Build Redmine"
23
  task :build do
24
    Rake::Task["test"].invoke
25
  end
26

    
27
  # Use this to cleanup after building or run post-build analysis.
28
  desc "Finish the build"
29
  task :teardown do
30
  end
31

    
32
  desc "Dump the environment information to a BUILD_ENVIRONMENT ENV variable for debugging"
33
  task :dump_environment do
34

    
35
    ENV['BUILD_ENVIRONMENT'] = ['ruby -v', 'gem -v', 'gem list'].collect do |command|
36
      result = `#{command}`
37
      "$ #{command}\n#{result}"
38
    end.join("\n")
39
    
40
  end
41
end
42