Created
September 20, 2011 03:25
-
-
Save nick-desteffen/1228245 to your computer and use it in GitHub Desktop.
EngineYard AppCloud Deployment Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :engineyard do | |
@environment = "your_application_production" | |
@git_tag = "HEAD" | |
desc "Upload Chef Deploy recipes" | |
task :upload_chef_recipes => [:environment, :set_eyrc] do | |
sh "cd ey-cloud-recipes && bundle exec ey recipes upload -e #{@environment}" | |
end | |
desc "Apply Chef Deploy recipes" | |
task :apply_chef_recipes => [:environment, :set_eyrc] do | |
sh "cd ey-cloud-recipes && bundle exec ey recipes apply -e #{@environment}" | |
end | |
desc "Upload and apply Chef Deploy recipes" | |
task :update_chef => [:environment, :set_eyrc] do | |
Rake::Task["engineyard:upload_chef_recipes"].invoke | |
Rake::Task["engineyard:apply_chef_recipes"].invoke | |
end | |
desc "Deploy to production" | |
task :deploy => [:environment, :set_eyrc] do | |
sh "bundle exec ey deploy -v -e #{@environment} --ref #{@git_tag} --migrate" | |
Rake::Task["engineyard:apply_chef_recipes"].invoke | |
end | |
desc "Throw up maintenance page" | |
task :web_disable => [:environment, :set_eyrc] do | |
sh "bundle exec ey web disable -v -a your_application -e #{@environment}" | |
end | |
desc "Take down maintenance page" | |
task :web_enable => [:environment, :set_eyrc] do | |
sh "bundle exec ey web enable -v -a your_application -e #{@environment}" | |
end | |
desc "Show environments" | |
task :environments => [:environment, :set_eyrc] do | |
sh "bundle exec ey environments" | |
end | |
desc "Sets the location of the EngineYard API Token" | |
task :set_eyrc => :environment do | |
ENV['EYRC'] = "#{Rails.root}/config/.eyrc" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment