Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

ec2:status command with capistrano-rbenv acutally runs command on each server #14

Closed
shishirsharma opened this issue Mar 21, 2014 · 6 comments

Comments

@shishirsharma
Copy link

me@ip-10-11-11-10:/home/user/work$ bundle exec cap production ec2:status
DEBUG [48cf88d9] Running /usr/bin/env [ ! -d /home/.rbenv/versions/2.0.0-p247 ] on ec2-11-11-219-24.compute-1.amazonaws.com
DEBUG [48cf88d9] Command: [ ! -d /home/.rbenv/versions/2.0.0-p247 ]
DEBUG [f93db4ad] Running /usr/bin/env [ ! -d /home/.rbenv/versions/2.0.0-p247 ] on ec2-11-11-67-29.compute-1.amazonaws.com

@rjocoleman
Copy link
Contributor

what's the issue here?

@shishirsharma
Copy link
Author

it is running "/usr/bin/env [ ! -d /home/.rbenv/versions/2.0.0-p247 ] " on each server.

ec2:status command should not run any thing on server.

@shishirsharma
Copy link
Author

My configuration has more then 200 instances. ec2:status is painfully slow.

@rjocoleman
Copy link
Contributor

cap-ec2 doesn't run anything on the server.

The capistrano-rbenv plugin you have installed is doing this - it's appears to be most of the point of that plugin: https://github.com/capistrano/rbenv/blob/master/lib/capistrano/tasks/rbenv.rake#L1-L31

https://github.com/capistrano/rbenv/blob/master/lib/capistrano/tasks/rbenv.rake#L28-L31 is a pattern I've seen in other capistrano v3 plugins. It's used to hook in to each stage, arbitrarily, by default. As such by running cap <stage> anything you're going to have rbenv:validate and rbenv:map_bins run.

I think if you set your set :rbenv_roles to something other than :all thats not in a ec2_role you could potentially avoid this.

@rjocoleman
Copy link
Contributor

Here's the source of this capistrano-rbenv feature: capistrano/capistrano#795

@andytinycat
Copy link
Contributor

Since this is a feature from another project, I'm going to close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants