fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Persistent State?


From: s s
Subject: Re: [Fab-user] Persistent State?
Date: Fri, 15 May 2009 13:38:22 -0400


On May 15, 2009, at 9:22 AM, Jorge Vargas wrote:

Hello,

I'm wondering if something like this is possible or more important
doable with the current code base.

My usecase is:

I'm using fabric to install an application (actually several which
almost the same deployment method) they all run on a specific port and
the port is given to me by an external service (hosting provider API).
What I want is a way to store these ports someone so my fabric
environment is aware of those variables. As you can tell this is
useful in many cases (for example user defined defaults or per server
constants)

seudo-python below:

def create_app(appname):
   result = api.create_app(appname)
   if result.message == 'success':
        environ[appname][port] = result.app.port

def update_supervisor(appname):
   cmd = '$VENV $INIFILE --port %s' % environ[appname][port]
   fabric.files.append(,'supervisord.conf)

Now of course this implied a run order, but most importantly I could
run create_app today and the update_supervisor command 10 days from
now. So that is why I want a persistent state. What do you guys think
about it?

I think this is a pretty useful use-case, could you maybe put it up on the Wiki?

Thanks,

S aka Steve Steiner






reply via email to

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