Skip to content

Instantly share code, notes, and snippets.

@albertoperdomo
Created April 16, 2010 22:57
Show Gist options
  • Save albertoperdomo/369074 to your computer and use it in GitHub Desktop.
Save albertoperdomo/369074 to your computer and use it in GitHub Desktop.
Sample rails rake task for continous integration and deployment
namespace :ci do
task :copy_yml do
sh "cp #{Rails.root}/config/example_database.yml #{Rails.root}/config/database.yml"
end
desc "Prepare for CI and run entire test suite"
task :build do
Rake::Task['db:migrate'].invoke
Rake::Task['db:test:prepare'].invoke
Rake::Task['test:units'].invoke
Rake::Task['cucumber:ci'].invoke
end
task :deploy do
sh "cap staging deploy"
end
desc "Prepare for CI and run entire test suite"
task :run => ['ci:copy_yml', 'ci:build', 'ci:deploy'] do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment