fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] make a deploy know if the preceding parameter was test or


From: Christian Vest Hansen
Subject: Re: [Fab-user] make a deploy know if the preceding parameter was test or production
Date: Tue, 17 Mar 2009 11:28:37 +0100

I tend to set an "environment" or "profile" variable in my test(),
production() and similar commands:

def test():
   config.profile = "test"

And then check it in the commands where I need to make decisions based
on its value:

def  deploy():
   require("profile", provided_by=[test, production])
   if config.profile == "test":
      test_specific_stuff()
   ...

Or with a decorator:

@requires('profile', provided_by=[test, production])
def  deploy():
   if config.profile == "test":
      test_specific_stuff()
   ...


On Tue, Mar 17, 2009 at 11:19 AM, Gregory Tappero <address@hidden> wrote:
> Hi,
>
> I have a test() and production() function as well as a deploy()
> I would like deploy() to vary depending on the previous parameter (test or 
> prod)
> Should i use fab_mode = "test" in test and do a if check or there are
> some better way using decorators.
>
> Thanks.
>
> --
> o/
>
>
> _______________________________________________
> 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]