Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add rake chef:app task

  • Loading branch information...
commit 20a7b025c5078f4e29c4df92ead8fafa881ed547 1 parent 8a90666
@evanphx evanphx authored
Showing with 39 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +38 −0 Rakefile
View
1  .gitignore
@@ -18,3 +18,4 @@ server/
tmp/
tags
.idea
+chef
View
38 Rakefile
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.