Mercurial > hg > soundsoftware-site
annotate lib/tasks/ci.rake @ 870:b8475c3e5f30 feature_126
Close obsolete branch feature_126
author | Chris Cannam |
---|---|
date | Sat, 02 Apr 2011 16:11:30 +0100 |
parents | 1d32c0a0efbf |
children | af80e5618e9b |
rev | line source |
---|---|
Chris@14 | 1 desc "Run the Continous Integration tests for Redmine" |
Chris@14 | 2 task :ci do |
Chris@14 | 3 # RAILS_ENV and ENV[] can diverge so force them both to test |
Chris@14 | 4 ENV['RAILS_ENV'] = 'test' |
Chris@14 | 5 RAILS_ENV = 'test' |
Chris@14 | 6 Rake::Task["ci:setup"].invoke |
Chris@14 | 7 Rake::Task["ci:build"].invoke |
Chris@14 | 8 Rake::Task["ci:teardown"].invoke |
Chris@14 | 9 end |
Chris@14 | 10 |
Chris@14 | 11 # Tasks can be hooked into by redefining them in a plugin |
Chris@14 | 12 namespace :ci do |
Chris@14 | 13 desc "Setup Redmine for a new build." |
Chris@14 | 14 task :setup do |
Chris@14 | 15 Rake::Task["ci:dump_environment"].invoke |
Chris@14 | 16 Rake::Task["db:create"].invoke |
Chris@14 | 17 Rake::Task["db:migrate"].invoke |
Chris@14 | 18 Rake::Task["db:schema:dump"].invoke |
Chris@14 | 19 end |
Chris@14 | 20 |
Chris@14 | 21 desc "Build Redmine" |
Chris@14 | 22 task :build do |
Chris@14 | 23 Rake::Task["test"].invoke |
Chris@14 | 24 end |
Chris@14 | 25 |
Chris@14 | 26 # Use this to cleanup after building or run post-build analysis. |
Chris@14 | 27 desc "Finish the build" |
Chris@14 | 28 task :teardown do |
Chris@14 | 29 end |
Chris@14 | 30 |
Chris@14 | 31 desc "Dump the environment information to a BUILD_ENVIRONMENT ENV variable for debugging" |
Chris@14 | 32 task :dump_environment do |
Chris@14 | 33 |
Chris@14 | 34 ENV['BUILD_ENVIRONMENT'] = ['ruby -v', 'gem -v', 'gem list'].collect do |command| |
Chris@14 | 35 result = `#{command}` |
Chris@14 | 36 "$ #{command}\n#{result}" |
Chris@14 | 37 end.join("\n") |
Chris@14 | 38 |
Chris@14 | 39 end |
Chris@14 | 40 end |
Chris@14 | 41 |