[chef] Best Practice :: Performing App Deployments with Chef


Chronological Thread 
  • From: Luke < >
  • To:
  • Subject: [chef] Best Practice :: Performing App Deployments with Chef
  • Date: Fri, 31 May 2013 07:28:05 -0700 (PDT)

All,

I’m reaching out to you from a project that is harnessing Chef to automate
deployment of Application artifacts that change regularly, such as EARs, WARs,
DB Schemas etc. This is definitely something that Chef can do however I feel
that the approach my team has come to is a poor one. I'm looking for a 'best
practice' solution to solving this particular problem with Chef. Let me 
explain
where my team stands right now...

Someone wants to deploy a new version of HelloWorld EAR into our Dev
environment. Presently he does this by kicking off a job in Jenkins which
simply exposes the target host and the application artifact to deploy.

Under the covers Jenkins SSH's onto the remote server and invokes the
'chef-client' command on that host, passing some JSON that specifies where the
recipe should get the EAR file from --- basically the version of the EAR since
the path is consistent.

So this works. Chef goes ahead and deploys the new artifact. Awesome. However
it seems really hacky. I don't like that this approach means that Environment
config on the Chef Server will always of date with our Environment JSON in
source control. 

I feel that the correct approach is to use Jenkins to update the JSON for the
environment you want to deploy to in source control, then updates Chef-Server
using knife. Finally Jenkins calls 'chef-client' on the box and it will work 
as
above.

The real value that I see from this second approach is that if you commit each
change to your environment's JSON to source control, you have traceability. 
The
other benefit is that you could build a totally new Chef Server (e.g. in a
second cloud) and because your source control is up to date with your
environment, you should get an identical environment built up by Chef. 
Finally,
everything is aligned: if you need to check what version of your app is
deployed to your dev environment you could check in source control, on Chef
server or on Jenkins and it will all be aligned.

What are your thoughts on these two approaches? I would like to see what the
Chef community has done to solve this problem before so I can align my project
with best practice in this particular area. Need your support :)

Many Thanks,
Luke


Archive powered by MHonArc 2.6.16.

§