fab-user
[Top][All Lists]
Advanced

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

Re(2): Re(3): [Fab-user] Revert deployments


From: Miguel A. Lamy
Subject: Re(2): Re(3): [Fab-user] Revert deployments
Date: Tue, 20 Jan 2009 08:59:38 +0000

Thanks for your reply.

I was reading and googling around and it seems Fabric is simpler and can suit 
my needs too.

So I´ll give it a try, thanks

Miguel Lamy

address@hidden on segunda-feira, 19 de Janeiro de 2009 at 23:35  wrote:
:As it happens, Fabric suits my needs perfectly, so I haven't really
:spent any time shopping around.
:
:I know there's a thing called Paver:
:http://www.blueskyonmars.com/projects/paver/ though it seems to have a
:broader scope.
:
:There's also that thing that Zed Shaw is (was?) building.
:
:I have never tried either, though.
:
:On Mon, Jan 19, 2009 at 11:01 PM, Miguel A. Lamy <address@hidden> wrote:
:> Hi Christian,
:>
:> I was rereading your post and thought if you think Fabric is the best tool 
to do what I need to do.
:>
:>
:> If you think Fabric is not that tool can you suggest me another one ?
:>
:> Thanks again.
:>
:> Miguel Lamy
:> GEDI, SA
:>
:> Miguel A. Lamy on segunda-feira, 19 de Janeiro de 2009 at 19:41  wrote:
:> :Hi Christian,
:> :
:> :I think I can figure out now a solution to my problem.
:> :
:> :Thanks a lot.
:> :
:> :Miguel Lamy
:> :
:> :
:> :address@hidden on segunda-feira, 19 de Janeiro de 2009 at 19:06  wrote:
:> :On Mon, Jan 19, 2009 at 7:03 PM, Miguel A. Lamy <address@hidden> wrote:
:> :> Hi all,
:> :>
:> :> I am evaluating Fabric and a I'm bit lost sorry... I think I'm putting 
dumb question.
:> :>
:> :> I want to deploy Java Web application into several servers. In the past I 
used some shell scripts that
:> :stoped
:> :> myservers, rsynced my app to the servers, backuped the databases (Mysql, 
SqlServer and Oracle) and
:started
:> :> the application server (tipical Jboss and Oracle). I use ssh in all 
servers with public keys.
:> :>
:> :> I was doing the deployment  server by server and sometimes the process 
didn't run as expected and I have
:> :> crashs during the startup of the application because of some program 
errors or inconsistency in the
:> :databases.
:> :
:> :A tool such as Fabric works best in homogeneous environments, ie. when
:> :all database servers are alike and all application servers are alike.
:> :In this mindset, any inconsistencies in the environment are bugs.
:> :
:> :When each server is different, then each server must be handled
:> :differently. This encourages fiddling, and fiddling leads to mistakes,
:> :and mistakes leads to... suffering.... in the form of down time, ahem.
:> ::)
:> :
:> :That said, Fabric is a pretty generic remote automation tool. :)
:> :
:> :>
:> :> So I thought may be I can use some tool out there that simplify that work 
and revert my process with no
:> :> pain...
:> :>
:> :> I read some documentation from Fabric site and from the github.com but 
still don't know how can I run
:> :> myscripts in a way that can "detect" errors in deployment and run some 
rollback code that reverts errors
:> :> during the deployment.
:> :
:> :Fabric cannot undo arbitrary shell commands.
:> :
:> :Fabric runs with a fail-fast mentality by default, but this can be
:> :overwriten on most remote operations by setting a `fail` kwarg to
:> :either "ignore" or "warn". When you invoke an operation, the call can
:> :be wrapped with a `try ... except SystemExit` of sorts, and that will
:> :give you a chance to do something when bad stuff happens.
:> :
:> :But what I usually do is to just implement a "rollback" command in my
:> :fabfile, and when I see that my deployment have failed, I can then
:> :decide whether to run it or not.
:> :
:> :>
:> :> I understand that I can use variables to store command result status and 
define rollback commands that
:can
:> :be
:> :> executed but my question is... can Fabric "detect" errors and 
automatically execute rollback functions
:in
:> :> case of some trouble ?
:> :
:> :An "error", in the sense of invoking some remote shell command, is
:> :when that command returns with a code other than 0.
:> :
:> :Fabric detects this and acts upon it in accord to the "fail" kwarg for
:> :that particular operation, which is "abort" by default.
:> :
:> :Aborting works by throwing SystemExit, and this is something that you
:> :can catch. However, Fabric was not designed with this use case in
:> :mind, to there is no additional information about what failed encoded
:> :in that exception.
:> :
:> :>
:> :> I want to deploy several servers and not be worried if one server didn't 
deployed correctly at 2.00AM
:and
:> :the
:> :> application server didn't start because of that failure. That server 
should automatically recover from
:that
:> :> bad deploy, revert to the previous status so in the morning I can analyse 
the errors and correct that
:> :errors
:> :> not worried that users can't run my application because of that failure.
:> :
:> :This is possible to do by calling your own "rollback" command in the
:> :except clause mentioned above.
:> :
:> :>
:> :> I'd appreciate any help given :-)
:> :>
:> :> (Sorry for my poor english)
:> :>
:> :> Miguel Lamy
:> :>
:> :>
:> :>
:> :> _______________________________________________
:> :> 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]