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: Gregory Tappero
Subject: Re: [Fab-user] make a deploy know if the preceding parameter was test or production
Date: Tue, 17 Mar 2009 11:44:51 +0100

Thanks !
It would be good to have a small wiki where we could put some
snippets, learning by example its always easier.
Its not a priority tho.

Greg

On Tue, Mar 17, 2009 at 11:28 AM, Christian Vest Hansen
<address@hidden> wrote:
> 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.
>



-- 
o/




reply via email to

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