2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2020

07/10/2008: Using SCP with Capistrano

t took me several hours to find out how to send a file to my remote computer via scp using Capistrano. It's 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)
Zemanta Pixie

07/09/2008: Capistrano, ElasticFox & EC2

What a nice combination of tools! I just installed Capistrano and created a capfile. From then on, I could run commands across all my virtual istances in one shot. This setup took just minutes. The only change that I made to my existing instances was to add a capistrano userid. My capfile looks like this:

role :files,
  "capistrano@ec2-75-101-225-105.compute-1.amazonaws.com",
  "capistrano@ec2-67-202-59-118.compute-1.amazonaws.com"

namespace :files do
  desc "Show free disk space"
  task :show_free_space, :roles => :files do
    run "df -h /"
  end
end

The best thing of all? No XML configuration!