summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-08-06 20:46:44 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-08-06 20:46:44 +0000
commitab546a14cb9f3e40b29df0fda5c82c8d779be843 (patch)
treeae986592173c6b1c7b8a1b0144ef1cb554959307 /lib
parent041bca6ac90d0d53c6e29a729e84b66b4d87b040 (diff)
downloadredmine-ab546a14cb9f3e40b29df0fda5c82c8d779be843.tar.gz
redmine-ab546a14cb9f3e40b29df0fda5c82c8d779be843.zip
Add a rake task to run CI.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3919 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/ci.rake41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
new file mode 100644
index 000000000..092575317
--- /dev/null
+++ b/lib/tasks/ci.rake
@@ -0,0 +1,41 @@
+desc "Run the Continous Integration tests for Redmine"
+task :ci do
+ # RAILS_ENV and ENV[] can diverge so force them both to test
+ ENV['RAILS_ENV'] = 'test'
+ RAILS_ENV = 'test'
+ Rake::Task["ci:setup"].invoke
+ Rake::Task["ci:build"].invoke
+ Rake::Task["ci:teardown"].invoke
+end
+
+# Tasks can be hooked into by redefining them in a plugin
+namespace :ci do
+ desc "Setup Redmine for a new build."
+ task :setup do
+ Rake::Task["ci:dump_environment"].invoke
+ Rake::Task["db:create"].invoke
+ Rake::Task["db:migrate"].invoke
+ Rake::Task["db:schema:dump"].invoke
+ end
+
+ desc "Build Redmine"
+ task :build do
+ Rake::Task["test"].invoke
+ end
+
+ # Use this to cleanup after building or run post-build analysis.
+ desc "Finish the build"
+ task :teardown do
+ end
+
+ desc "Dump the environment information to a BUILD_ENVIRONMENT ENV variable for debugging"
+ task :dump_environment do
+
+ ENV['BUILD_ENVIRONMENT'] = ['ruby -v', 'gem -v', 'gem list'].collect do |command|
+ result = `#{command}`
+ "$ #{command}\n#{result}"
+ end.join("\n")
+
+ end
+end
+