Skip to content

Instantly share code, notes, and snippets.

@nick-desteffen
Created September 20, 2011 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nick-desteffen/1228245 to your computer and use it in GitHub Desktop.
Save nick-desteffen/1228245 to your computer and use it in GitHub Desktop.
EngineYard AppCloud Deployment Script
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