fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Remote fabfile


From: Kevin Horn
Subject: Re: [Fab-user] Remote fabfile
Date: Wed, 1 Oct 2014 15:12:47 -0500

On Wed, Oct 1, 2014 at 2:12 PM, Jeff Forcier <address@hidden> wrote:
There's no way to do this built in (nor do I see it as necessarily
being worth the development effort offhand - feels like a niche use
case and prioritzation is unfortunately a thing), but the first thing
that springs to mind is using shell tools like zsh's temporary-file
support, e.g.:

    $ fab -H <target> -f =(curl
https://raw.githubusercontent.com/<user>/<repo>/<ref>/fabfile.py)
task:<params>

Where '=(<command>)' creates a local temporary file containing the
stdout of <command>, then expands into that temporary filename.
Presumably bash 4 and other common shells also offer something like
this.

Bash does, though I can't recall offhand how to do it exactly.  IIRC it's pretty similar to zsh, but my memory is notoriously faulty.
 
You could also use Python for this, though it'd be more work - e.g.
have a setup task that performs the download, calls __import__ on the
temp file, then hands the resulting module object to Fabric's CLI
functions.

You might check out Plumbum: https://pypi.python.org/pypi/plumbum

I think it would be fairly easy to rig something up with it.
 

On Tue, Sep 30, 2014 at 4:52 PM, Irving Rabin <address@hidden> wrote:
> Folks, I am new to Fabric and I have written quite a complicated fabfile.py
> script. It is used to install a product. The script resides along with a
> product on a Github. I don't want to clone the whole product to the local
> machine, so my question is simple - can I provide a network address of
> fabfile to fab command, something like this:
>
>     fab -H <host-name> -f address@hidden:<my-repository>/<path>/<filename>
> task:<parms>
>
> Pretty much any elegant idea of getting just a single file should suffice.
> But providing a network path for this file would be probably the best
> solution.
>
> Thanks,
> Irv Rabin
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user
>



--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org

_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user



--
--
Kevin Horn

reply via email to

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