Sha256: aa96f0700c87efda5db48d8e05f49a49a78720fb7aac6622ef3975dc1a94013e

Contents?: true

Size: 1.39 KB

Versions: 24

Compression:

Stored size: 1.39 KB

Contents

require 'cap_recipes/tasks/utilities.rb'

Capistrano::Configuration.instance(true).load do

=begin # Set these vars. 
  ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "id_rsa.pub")]

  set :public_key, "id-KEYNAME" # the keypair to use for the instance
  set :cert_code, "CERT_CODE" # the code for the private key and for the certificate
  set :bundle_host, "DOMAIN.com" # the domain for the site
  set :account_id, "ACCOUNTID" # your account_id without dashes
  set :bundle_name, "BUNDLE" # the name of the bundle
  set :store_bucket, "BUCKET" # the name of the bucket
  set :access_key_id, "ACCESS KEY"
  set :access_secret_key, "SECRET KEY"
=end


  namespace :ec2 do
    desc "bundles up our innercalm image"
    task :bundle do
      utilities.with_credentials :user => 'root' do
        system("scp -i ~/.ec2/#{public_key} ~/.ec2/pk-#{cert_code}.pem ~/.ec2/cert-#{cert_code}.pem root@#{bundle_host}:/mnt")
        run "rm -f /mnt/#{bundle_name}"
        run "export PATH=/usr/bin:$PATH; ec2-bundle-vol -d /mnt -k /mnt/pk-#{cert_code}.pem -c /mnt/cert-#{cert_code}.pem -u #{account_id} -r i386 -p #{bundle_name}"
        run "ls -l /mnt/#{bundle_name}.*"
        run "export PATH=/usr/bin:$PATH; ec2-upload-bundle -b #{store_bucket} -m /mnt/#{bundle_name}.manifest.xml -a #{access_key_id} -s #{access_secret_key}"
        system("ec2-register #{store_bucket}/#{bundle_name}.manifest.xml")
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
crazycode-cap-recipes-0.5.3 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.5.2 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.5.1 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.5.0 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.14 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.13 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.12 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.11 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.10 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.9 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.8 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.6 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.5 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.4 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.3 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.2 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.1 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.4.0 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.3.39.3 lib/cap_recipes/tasks/ec2/manage.rb
crazycode-cap-recipes-0.3.39.2 lib/cap_recipes/tasks/ec2/manage.rb