look at using hostfilter instead

http://stackoverflow.com/questions/429816/how-to-deploy-to-a-single-specific-server-using-capistrano


On Sat, Feb 22, 2014 at 2:30 AM, Carlos Peñas <theist...@gmail.com> wrote:

> Hi
>
> In capistrano 2.15 I'm getting some trouble limiting task execution,
> using ROLES environment variables
>
> if I use ROLES=role and call a task which have some "after" hooks, the
> tasks indicated by these hooks are called regardless the roles indicated
> in the task.
>
> For example in this example cap file:
>
> server "127.0.0.1", :web, :app
> server "127.1.1.1", :app, :db
>
> task :do_all do
>   run "echo hi do all"
> end
>
> task :do_db, :roles => :db do
>   run "echo hi do db"
> end
> after :do_all, :do_db
>
> task :do_app, :roles => :app do
>   run "echo hi do app"
> end
> after :do_all, :do_app
>
> task :do_web, :roles => :db do
>   run "echo hi do web"
> end
> after :do_all, :do_web
>
> If I call ROLES="db" cap do_all
>
> I get:
>
>   * 2014-02-22 11:15:33 executing `do_all'
>   * executing "echo hi do all"
>     servers: ["127.1.1.1"]
> Password:
>     [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do all
>     command finished in 13ms
>     triggering after callbacks for `do_all'
>   * 2014-02-22 11:15:44 executing `do_db'
>   * executing "echo hi do db"
>     servers: ["127.1.1.1"]
>     [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do db
>     command finished in 3ms
>   * 2014-02-22 11:15:44 executing `do_app'
>   * executing "echo hi do app"
>     servers: ["127.1.1.1"]
>     [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do app
>     command finished in 3ms
>   * 2014-02-22 11:15:44 executing `do_web'
>   * executing "echo hi do web"
>     servers: ["127.1.1.1"]
>     [127.1.1.1] executing command
>  ** [out :: 127.1.1.1] hi do web
>     command finished in 3ms
>
> So the ROLES variable is limiting the server to apply the tasks but not
> the tasks applied. I'd expected do_all, do_db but not do_web and do_app
>
> Is there a way to achieve the behavior I expected? Im stuck in this
> scheme of after :this, :do_that and I really need do partial task apply
> to a role
>
> Thanks.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capistrano+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/5187fb3e-6e14-42ea-82c1-1c162d174d5f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/CABV8oi%3DUeFprSKx5kj7NG40yMZ6DgQv-J1NKCkGD8ZzKS5mcsw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to