Posts

Showing posts with the label capistrano

Using SCP with Capistrano

Image
Using SCP with Capistrano It took me several hours to find out how to send a file to my remote computer via scp using Capistrano. Its actually quite easy. There is a method called upload which has a via option. Here is an example of its use: upload("products.txt", "/home/medined", :via => :scp) If you need to change the files name, you can also specify it in the second parameter. For example, upload("products.txt", "/home/medined/products_new.txt", :via => :scp) download  file  now

Using Capistrano to Bundle Amazon EC2 Images

Image
Using Capistrano to Bundle Amazon EC2 Images Ive found the following bit of Capistrano script to be useful when tinkering with EC2 images. I can make a change and then bundle the image with just one command: cap admin:bundle The most difficult part of this script was finding out how to upload files to the remote instance using scp . The rest is fairly straightforward. I am only posting this script because I havent seen this functionality posted anywhere else. # capfile for Amazon EC2 Bundling. Normally, a yaml file would be # hold configuration parameters. I am using environment # variables because they are also used by the EC2 # programs - why have the information in two places? # This script assumes that you are only bundling one # instance at a time. # EC2 Instance Hostname to be bundled. ec2_hostname = ENV[BUNDLE_EC2_HOSTNAME] # S3 Bucket Name (where the bundle is uploaded) s3_bucket_name = ENV[BUNDLE_S3_BUCKET_NAME] # If you are using ElasticFox (and if not, why not?) that # you...