use Amazon EC2 tools in Capistrano to get the servers to push the code

Posted by APZ on Server Fault See other posts from Server Fault or by APZ
Published on 2011-11-21T16:53:43Z Indexed on 2012/11/23 11:03 UTC
Read the original article Hit count: 214

Filed under:

I am trying to use EC2 tools to get all the machines with a particular tag in some type of array in /config/deploy/prod.rb file in Capistrano. Something like this:

In prod.rb file:

//untested command
workers-array[]=$(ec2-describe-instances -F vpc-id=1234 -F tag:Env=prod -F     tag:SystemType=worker)
 for(i=0;i<workers-array.len;i++){
     role :worker-A, workers-array[i]
   }

I am not sure how we can do this in capistrano, am new to ruby too. Guys any help on this would be really appreciated.

© Server Fault or respective owner

Related posts about amazon-ec2