fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Can I pass in information from the command-line to my functio


From: Matthew Wilson
Subject: [Fab-user] Can I pass in information from the command-line to my functions?
Date: Tue, 18 Aug 2009 14:47:59 -0400

Right now, when I upgrade my production box to the next version of my
web app, I run a set of commands manually.

I'm working on converting all this to using fabric.

Here's the commands I run to upgrade my web app from revision 13 to revision 14:

$ sudo supervisorctl stop all # this shuts down a bunch of scripts and
my web server.
$ cd ~/projects/webapp
$ git fetch origin
$ git checkout -b rev14 origin/rev14
$ sudo supervisorctl start all


When I upgrade from rev14 to rev15, it's going to be roughly the same
steps, but I'll be checking out rev15 instead.

I want to run fabric sort of like this:

$ fab upgrade_webapp --revision rev14

And then in my upgrade_webapp function, somehow use that revision
rev14 as a dictionary that I can interpolated into my strings.

Is this possible?

How are other people solving problems where the functions are
effectively identical except for parameters?

Matt



-- 
Matthew Wilson
address@hidden
http://tplus1.com




reply via email to

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