Created
March 26, 2012 05:09
-
-
Save corck/2203135 to your computer and use it in GitHub Desktop.
Create and upload AMI - Rake task
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
desc "create ami bundle and upload it to s3" | |
task :create_and_upload_bundle do |channel, stream, data| | |
set :user, 'app' | |
message = "Please enter platform [i386|x86_64]" | |
platform = Capistrano::CLI.ui.ask(message) | |
message = "Please enter a bundle name:" | |
bundle_name = Capistrano::CLI.ui.ask(message) | |
sudo "rm -r /mnt/image; true" | |
sudo "ec2-bundle-vol -e /volume1,/volume2 -d /mnt -k ~/.ssh/XXXXX.pem -c ~/.ssh/cert-XXXXX.pem -u USERID -r #{platform}" | |
#sudo "ec2-bundle-vol -d /mnt -k ~/.ssh/XXXXX.pem -c ~/.ssh/cert-XXXX.pem -u USERID -r #{platform}" | |
sudo "ec2-upload-bundle -b #{bundle_name} -m /mnt/image.manifest.xml -a KEY -s SECRET" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment