Bah. HOSTROLEFILTER appears to do what I actually wanted... The only docs I've found for any of this is in "cap -H", and it's still very confusing what ROLES vs HOSTROLEFILTER actually does. I don't understand what ROLES actually does, at all.

And HOSTROLEFILTER does what I want, but doesn't work, because....

`deploy:assets:symlink' is only run for servers matching {:roles=>[:web], :except=>{:no_release=>true}}, but no servers matched

Becuase, yeah, I'm intentionally trying to run only against a certain role, which is not :web. I guess that task, built into capistrano, would have to be rewritten to do the :on_no_match=>:continue thing, or whatever it was, which would probably be a problem for someone else.

This whole thing is a big ball of confusing mess. I wish there was an easy way for me to say "Yeah, deploy, but ONLY to this certain role", without rewriting a bunch of cap stuff myself, but I don't think there is.


On 12/5/2012 9:43 AM, Jonathan Rochkind wrote:
I am actually still unable to find any docs of the ROLES env variable, or " 
ROLE(S)FILTER" (not even sure what that means!).  Can anyone point me to the right 
place?
________________________________________
From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
Jonathan Rochkind [rochk...@jhu.edu]
Sent: Wednesday, December 05, 2012 9:40 AM
To: capistrano@googlegroups.com
Subject: RE: [capistrano] precompile assets task, roles

Ah, okay, I'll look around for docs. (ROLES seemed to do what I needed at 
first, but clearly not! Still confused on what it does, but i'll look around, 
although had trouble finding docs before, I just got it from someone elses 
(misleading) blog post).

What I _want_ to do is "Run only the tasks applicable for role X, on the servers for 
role X. Pretend nothing but role X exists."

Make sense?  Is there no way to do it?  Am I a unique snowflake, or is this a 
common use case? (It seems to me like it would be common).  I am indeed using 
custom roles -- but I don't want to have to remember the current configuration 
of which servers have which roles (nor do I neccesarily want to run ALL tasks 
on that server(s), I just want the run the ones for certain roles).  Is there 
any way to set that up?

If not, and I'm not a unique snowflake, would the capistrano committers look 
kindly on a pull request to add the feature, if I can figure out how?  Any 
comments on what the end-user-facing cli api should look like (since ROLES is 
apparently already taken!)
________________________________________
From: capistrano@googlegroups.com [capistrano@googlegroups.com] on behalf of 
Donovan Bray [donno...@gmail.com]
Sent: Tuesday, December 04, 2012 11:55 PM
To: capistrano@googlegroups.com
Subject: Re: [capistrano] precompile assets task, roles

ROLES probably doesn't do what you think it does; look at the docs for 
ROLE(S)FILTER as well.

I've never found either to be useful so I avoid them like the plague.

Instead I build custom roles.

I define stages in tasks and use the server helper instead of the role helper.



On Dec 4, 2012, at 3:15 PM, Jonathan Rochkind <rochk...@jhu.edu> wrote:

Huh, actually, it looks like this IS working as expected normally...

Where it broke is when I ran:

`cap ROLES=indexer_jobs deploy`

Somehow when you tell it to only run on servers with listed role... THEN it 
messes up and runs tasks that don't apply to that role on those servers too? 
Maybe?  Ring a bell for anyone? Is this a bug?

On 12/4/2012 6:13 PM, Jonathan Rochkind wrote:
My cap recipe for a Rails app has just grown to more than one server;

I now have a server where the source is installed (in order to then set
some rake cronjobs on that server), but it's not actually an app/web
server.

So I don't want asset precompile to run there.

But asset precompile seems to be running there anyway. Looking at the
actual code at:
https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy/assets.rb


I'm not sure why... it looks like it should only run the
assets:precompile task on servers with role `assets_role`, which
defaults to `web`.

This server does not have the role 'web', in fact it only has one role,
one custom one I made up ("indexer_jobs")... but the assets:precompile
task seems to be triggered there anyway.

Anyone have any clues what might be going on, or suggestions for how I
can get to the bottom of this?


--
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

--
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

--
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en


--
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to capistrano@googlegroups.com
* To unsubscribe from this group, send email to 
capistrano+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to