fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] grouping tasks


From: Christian Vest Hansen
Subject: Re: [Fab-user] grouping tasks
Date: Fri, 29 Jan 2010 19:58:41 +0100

Tasks are just python functions. You can create a task `deploy` like
this, for instance:

def deploy():
  deploy_db()
  deploy_app()
  deploy_daemons()
  deploy_queue()

On Fri, Jan 29, 2010 at 3:54 PM, Jiri Barton <address@hidden> wrote:
> Hi,
>
> I was wondering if there is a way to group tasks and then refer to the
> group by one name. I don't want to start but sort of what namespaces in
> Capistrano could be used for.
>
> What I'm trying to do is to deploy to several machines which are domain
> specific. I have a database machine, a web server with the application
> code, a machine which runs daemons, and a machine for command queuing.
> Of course, each machine has specific needs and it would be more fitting
> if I defined different fabric tasks for each of them, like:
>
> def deploy_db():
>    #migrate the db schema
>
> def deploy_app():
>    #restart web server
>
> def deploy_daemons():
>    #restart all app daemons
>
> def deploy_queue():
>    #restart the queuing manager
>
> Now, what I have to do is
>
> fab deploy_db deploy_app deploy_daemons deploy_queue
>
> What I had rather do is
>
> fab deploy
>
> This would call those four tasks from above.
>
>
> The reason for that is the deployment plan - the order in which the
> deployment tasks are run - hardly ever changes but the order of the
> tasks is essential. Sometimes I need to restart some services on other
> machines and so this deployment plan changes.
>
> Is there a way?
>
> Thanks
> Jiri
>
>
>
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]