fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Uploading different files to different remote hosts


From: Jeff Forcier
Subject: Re: [Fab-user] Uploading different files to different remote hosts
Date: Thu, 21 Oct 2010 11:14:44 -0400

Hi,

Two ways offhand:

@hosts('host1')
def upload1():
    put('local', 'remote')

@hosts('host2')
def upload2():
    put('local2', 'remote2')

Invoke as "fab upload1 upload2" (calling them from other top level
tasks doesn't currently do what you might expect, due to how @hosts
works).

Another way, which will work when called as a subroutine as well:

def upload_stuff():
    with settings(host_string='host1'):
        put('local', 'remote')
    with settings(host_string='host2'):
        put('local2', 'remote2')

HTH,
Jeff

On Thu, Oct 21, 2010 at 11:04 AM, Yungwei Chen <address@hidden> wrote:
> Hi,
>
> I would like to know how to upload different files to different remote hosts 
> in the fabfile.
> Thanks.
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



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



reply via email to

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