To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / dc / dcac5a29f794b90b0c70d7b180bb1c20ea9606aa.svn-base @ 1297:0a574315af3e
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 |
|