cap servername deploy isnt working when servername has multiple roles
masha256 opened this issue · comments
The deploy:assets:symlink task fails when doing a single server deploy to a server that has multiple roles (including the role that matches assets_role).
At first my server had "Roles" set to "app,db" and got the below error. When I edited the "Roles" aws tag to only have 'app', the deploy worked. I have assets_role defined as :app. So it seems something is not registering the server under the 'app' role when it is listed as having multiple roles.
I made sure the following was also in my deploy.rb:
ec2_roles :name=>:app, :options => {:default=>true}
ec2_roles :name=>:db, :options => {:default=>true}
When running "cap server1 deploy", I get the following error:
*** [deploy:update_code] rolling back
- executing "rm -rf /home/ubuntu/apps/myapp/releases/20130918175119; true"
servers: ["ecxxxxxxxx.compute-1.amazonaws.com"]
[ecxxxxxxxx.compute-1.amazonaws.com] executing command
command finished in 920ms
`deploy:assets:symlink' is only run for servers matching {:roles=>#<Proc:0x007f9e648bdf08@/Users/machado/.rvm/gems/ruby-1.9.3-p392@leaddyno-app/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/assets.rb:42 (lambda)>, :except=>{:no_release=>true}}, but no servers matched
Just checking, is this issue occurring even with the latest version of the gem (1.5.1)? I'll take a look as soon as I can otherwise.
Sorry, yep I made sure I was using 1.5.1.
That's a pain then! Would you mind attaching some diagnostic information, such as the output from ec2:status
(filter out IPs etc for your privacy) and also, whatever you can share from your deploy.rb
? As soon as I have time, I'll look into reproducing this and see if I can find a solution :)
Thanks!
Hey there, just been checking into this some more, and wondered if this had anything to do with it? capistrano/capistrano#128
Although they claim to have fixed it, Capify-EC2 currently requires an older version of Capistrano I believe, so it might be worth trying to ordering suggestion in that issue?
Hey there, since it's been a while, I'm going to close this issue, but feel free to re-open if you're still having trouble!
My experience with this issue was when a server belonged to multiple roles. Whenever I do;
cap production servername deploy
It'll only recognize the "last" "ec2_roles" attribute (in my case, it wasn't :app) and so I had similar errors to
@machadolab.
To debug I have a task called :dump
# For debugging purposes
task :dump do
puts roles.inspect
end
When using;
cap production deploy:dump - all roles were shown.
cap production servername deploy:dump - only the "last" role would appear.