How do you do deployments?


How do you do deployments?

Posted by Luis Majano
Apr 06, 2011 16:56:14 UTC
This is an open question to bring in your comments about source code deployment.  There are several ways and tools and I am very interested in your approaches.  What are your deployment flows? What tools do you use? How do you integrate git/svn into the mix? How do you deal with tiers?

Anyways, I will write about my personal experiences, but wanted to kick off a conversation on deployment strategies for ColdFusion.



Jim Priest

I've got deployments down fairly well with Ant. One thing I do struggle with is the database however. I'd love to hear how people manage to keep files, schema and data all in sync.

Brian

At the office we do Flex/Java development and we use Maven for our build and deploy process. We use the Maven Release Plugin to handle bundle release artifacts and the Cargo Plugin to hot deploy WARs onto Tomcat servers.

We've incorporated SQL migrations into our build process using the Carbon-Five DB Migration Plugin for Maven. Unfortunately, there is no hook for Ant, but there is a Java integration guide (http://code.google.com/p/c5-db-migration/wiki/ApplicationEmbedding) which could be ported to an Ant task with a little work. The plugin doesn't support rollbacks, but I'm sure there are folks out there working to extend it ... :) What's the best about this plugin vs the other Maven and Ant plugins I've encountered, is that based on the JDBC driver added as dependency, it can detect nuisances between DB servers and send out statements correctly for processing. For example, when scripting an SP for MySQL, you sometimes want to change the delimiter from ; to ;; so you can use semicolons in the SP code itself and not get it confused with an end of statement. This plugin won't puke on those scripts, whereas I've found that the stock Ant plugin and the Maven SQL plugin will.

All this being said, Maven has its pain points when working with tooling for langs other than Java. I use Ant for my OSS efforts with Flex and have used it with CF with success. If you're a fan of Groovy, Gradle which is a nice marriage of both worlds, but if it's too much of a shift, GAnt is a great way to get some programmatic features (e.g. - iteration) into Ant without using libraries like AntContrib.

If you want a great intro/overview of this space, check out the Continuous Delivery book in the Fowler series. I just picked it up and it's a great read.

Sami Hoda

Luis,

We just revamped our system. Jenkins (formerly Hudson) [Master/Slave setup] + Ant + Git + MXUnit that'll rock your world. Next time you drop by, we'll show you. All thanks to Joseph who took an idea in my head and ran with it.

Andrea

I am using Capistrano that is a ruby/rack programm that perform deployment from a test machine to an undefined number of production machines. Is a great way to deploy cause allows a very very easy rollback system if anything goes wrong.

ashamed

Still using CVS and working off a dev sandbox. Requests for moving code to test and prod have to be sent to a systems admin and then he manually updates the folders we ask him from our CVS repo. On a different environment we use the old FTP to move files to our own accounts and from there we have to sudo in and copy the files from our folders to the final destination.

Really interested in learning how other people do this. I've used Jenkins/Hudson before and Ant but here the culture is a bit different.

Aaron Greenlee

I edit all my files on my production box.

Kidding! Great question Luis. I use ant but still manually roll code to servers. I take two or three out of the load balancer, pull the update and run some events that preload caches, confirm the new code worked as expected and reintroduce the servers back into the load balancer. I've been looking to further automate with Ruby or Groovy but have not found the time to automate the actual deployment phase. Doing pretty well with automation before the commit though.

I hope is post receives a lot of comments. Looking forward to seeing other solutions.

Thanks.

Luis Majano

@andrea great to hear from you HERMANO! Would you be willing to share your setup? @jim do you do full code deployments with ANT or patched releases. For example, let's say only 3 files changed on an app. Does the entire site go up via ANT or only those 3 changes? How do you control that?

Luis Majano

My experiences in the past was a custom system I built using CF/Flash + robocopy. We had a flash interface that packaged bundles of code (much like projects) and called CF to deploy to different tiers. CF would then execute robocopy scripts to move changed resources and synchronize the tiers.

Josh

Where I am at we normally create a diff zip package that is created using some bat files to only grab the updated files between revisions in svn. We commit the db scripts and have a tool that combines all the database script files into one file so we can run it when we deploy to a multi server environments.

Dan Fredericks

I am also very interested in what people use. I can't even get us to use source control, we just create different folders to store "branches". When the developers that are allowed to access production copy files, they were using a program called beyond compare to copy lines of files from the dev file to the prod file. Now, due to changes in our network setup, they copy the file to a jump drive, and copy them up to the prod server and either use beyond compare, or just manually scan the file for the line changes. I'd really like to hear about ALL the different ways to copy code from dev to prod...what else is there besides ANT?

thanks Dan

Larry C. Lyons

It depends. with may of the jobs I've done its been a matter of manually copying up the changed files to the server. AT this one job we used a combination of ANT, Maven/CruiseControl and RSYNC to do the deployment.

In another job, I thought they had the best setup. After you checked in your work into your branch, and then after it had been approved on dev we would merge our changes in SVN to the staging or production server. We'd then use an ant task to update code on the Staging server. We used a more automated process for production, involving an ant task exporting from the SVN server, getting all the necessary support files (from a CFEnterprise War file), Warring the files together and then using FTP to deliver the WAR file to the deploy directory of a remote Jboss app server. During the next JBoss lifecycle, the app server would notice the changed WAR file and then deploy it to the other members of the cluster.

Vamshi

We use cruisecontroller for making builds to DEV. it runs on integration box, whenever there is a new commit on git (now we are using FI) it runs all JUnits tests, builds code and deploys to DEV.

Coming to QA and PROD deployment we use Capistrano script which runs JUnits tests, builds and exports the code to QA and PROD environments.

Vamshi.

Dani

We use git for DEV then people use winSCP to replace files on production. SQL is handled manually.

I would like to use git, so if we decide a version is good, we could tag it and execute "git checkout " on prod..

JIm

Just following up (finally)...

In the past I've always gone with completely replacing all the files in production with Ant. Even large projects only take a few minutes. That completely eliminates the "I forgot to update a file" issue.

At my current position they have a checked out copy in production and are manually updating files and during a rollout Monday I forgot to update a particular file and it was a mess. I'll be automating that next time :)