fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] fab "let" command


From: Christian Vest Hansen
Subject: Re: [Fab-user] fab "let" command
Date: Thu, 15 Oct 2009 17:56:16 +0200

On Thu, Oct 15, 2009 at 4:24 PM, Jeff Forcier <address@hidden> wrote:
> Yea, I'm fine with adding another CLI flag for setting env vars. Would
> rather avoid a "fake task", though, in favor of something like e.g.

I can see how not having fake tasks keeps things tidy.

>
>    $ fab --env "foo=bar,biz=baz"

Just to list an alternative, the java program can take properties
through command-line arguments in this format: -Dfoo=bar so something
like -Efoo=bar might be a way to go for fabric, where E stands for
environment.

>
> -Jeff
>
> On Thu, Oct 15, 2009 at 9:51 AM, Christian Vest Hansen
> <address@hidden> wrote:
>> Poof! I just ran into this one.
>>
>> Consider this a vote to get `let` back at some point.
>>
>> Until then, this (probably way simplified and naïve) implementation in
>> my fabfile covers my needs:
>>
>> def let(**kvargs):
>>  "Define the provided arbitrary key-value arguments as attributes in env."
>>  env.update(kvargs)
>>
>>
>> On Sun, Jul 12, 2009 at 6:30 PM, Jeff Forcier <address@hidden> wrote:
>>> Hi Ben, apologies for the delay in replying!
>>>
>>> There's no replacement for the old global 'let' flag right now, but
>>> that's mostly because I haven't taken the time to re-examine it and
>>> see how such a feature fits into the new scheme of things. Something
>>> like that may well show up again in the future.
>>>
>>> One option that may be used as a workaround is to specify arguments to
>>> your tasks, e.g. "fab deploy:fixtures=my_fixture.json", which is
>>> equivalent to calling "deploy(fixtures='my_fixture.json')". This is
>>> subtly different from setting env vars directly, but can serve much
>>> the same purpose. The docs for this aspect of Fabric can be found
>>> here:
>>>
>>>    http://docs.fabfile.org/0.9/api/main.html#fabric.main.parse_arguments
>>>
>>> Otherwise, as you mentioned, you could write tasks to do this for you
>>> -- even make your own "let" to set env vars, which coincidentally
>>> would have the same syntax as the old let builtin, due to how the
>>> above task args feature works.
>>>
>>> Best,
>>> Jeff
>>>
>>> On Thu, Jul 9, 2009 at 5:44 PM, Ben Davis<address@hidden> wrote:
>>>> One other thing I've also noticed while upgrading to 0.9,  is that the 
>>>> "let"
>>>> command no longer works.  For example, one of my commands would be
>>>>
>>>> fab staging let:fixtures=my_fixture.json deploy
>>>>
>>>> My deployment script would then set the fixtures variable and I could use
>>>> that in any of my functions.   Is there a way to do this w/ 0.9?  Or is it
>>>> just a matter of writing my own "let" command?
>>>>
>>>> _______________________________________________
>>>> Fab-user mailing list
>>>> address@hidden
>>>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Fab-user mailing list
>>> address@hidden
>>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>>
>>
>>
>>
>> --
>> Venlig hilsen / Kind regards,
>> Christian Vest Hansen.
>>
>



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




reply via email to

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