Skip to content

Commit

Permalink
Add rake chef:app task
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Feb 8, 2013
1 parent 8a90666 commit 20a7b02
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,3 +18,4 @@ server/
tmp/
tags
.idea
chef
38 changes: 38 additions & 0 deletions Rakefile
Expand Up @@ -6,3 +6,41 @@ task :default => [:test, :cucumber]

desc "Run weekly at 00:00 UTC"
task :weekly_cron => %w[gemcutter:rubygems:update_download_counts]

namespace :chef do
task :setup do
if File.directory? "chef"
sh "cd chef; git pull --rebase"
else
sh "git clone git@github.com:rubygems/rubygems-aws chef"
end
end

desc "Provision the application instances in AWS"
task :app => :setup do
unless ENV['DEPLOY_USER']
puts "Please set DEPLOY_USER to your AWS username"
exit 1
end

unless ENV['DEPLOY_SSH_KEY']
puts "Please set DEPLOY_SSH_KEY to be the path to your SSH to use"
exit 1
end

files = ["chef/chef/data_bags/secrets/rubygems.json",
"chef/chef/site-cookbooks/rubygems/files/default/rubygems.org.crt",
"chef/chef/site-cookbooks/rubygems/files/default/rubygems.org.key"]

files.each do |f|
unless File.file? f
puts "Missing '#{f}': get it from another committer"
exit 1
end
end

ENV['RUBYGEMS_EC2_APP'] = "ec2-54-245-134-70.us-west-2.compute.amazonaws.com"

sh "cd chef; cap rubygems.org chef:app"
end
end

0 comments on commit 20a7b02

Please sign in to comment.