Specifically what I am getting at is a notification.

I have a deploy task that deploys the website to all my webheads.
Abbreviated task follows:

task :production do
  set :default_environment {}
  roles :app one.foo.com, two.foo.com, three.foo.com
  deploy.notify_via_boxcar
end

This deploys to all 3 servers.  I want a deploy notification (via
Boxcar) which is a deploy task.  Originally I had it running via
"after 'deploy:update_code'", but that runs it on every machine.  I
just want the notification to fire when the whole task of deploying to
all servers is complete.  When I put it in the :production task (like
above), it doesn't do the normal deploy tasks.  Where should I put it
to only fire on the completion?  I remember reading something about
on :exit, but I couldn't find the docs to implement that.

-e

On Jul 21, 11:36 am, Donovan Bray <[email protected]> wrote:
> Tasks run in parallel on all matching servers, if you have a task that you 
> need to only run on any one of the servers, like maybe a rake task that 
> changes data in the db, you only need one server to run that command
>
> You can create a role with one server as suggested, you can also pass :once 
> => true to the run or sudo comand
>
> run 'my command', :once => true
>
> It will only run on the first matching server.
>
> out = capture 'my command'
> logger.info out
>
> Would do the same thing, but I would only use that form if you wanted to do 
> something with the output than just echo it back to the console.
>
> On Jul 21, 2011, at 5:19 AM, Lee Hambley <[email protected]> wrote:
>
>
>
>
>
>
>
> > Eric,
>
> > > I am trying to figure out how to get a task to only fire one time.
>
> > Tasks run once, they shouldn't run "once per server" they do run "once on 
> > each server"
>
> > If you then have a task that should run on only one server in your group, 
> > you need to isolate it somehow, name it with a responsibility, or give it a 
> > tag, such as how the default recipe names a primary DB server.
> > --
> > * You received this message because you are subscribed to the Google Groups 
> > "Capistrano" group.
> > * To post to this group, send email to [email protected]
> > * To unsubscribe from this group, send email to 
> > [email protected] For more options, visit this group 
> > athttp://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 [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to