The main benefit of expressing your deployment in xml or any code for that matter is the ability to version it in a repository. But with such an action comes many questions and options. The main issue with this is that once you’ve stabilized your deployment how do we change it without destabilizing other environments ? The best way to do this is with branching. All revision control systems have some concept of branching and merging. Since GIT is such a popular item with most customers, we will use that as an example for this article in a “GitFlow” context.
Problem 1: My application has a development and master branch as well as feature and bugfix branches. Those differences in code may very well have differences in configurations and deployment methodologies. How does leroy fit into this picture ?
Answer: Add a leroy folder to your project and branch the leroy configurations with your project. Setup a separate build environment that performs a continuous deployment upon successful build using the leroy configuration in your folder. Set your build settings so that the deployment must return successful in order for your application build to be marked success. This way your entire set of artifacts are grouped together and labeled as successful. As you promote your artifact, you are promoting the deployment.
Problem 2: Answer to problem #1 sounds great, but many times I need to change my deployment without changing my application. I could add new servers or new environments. I don’t want to have to rebuild my application every time I make a change to the deployment.
Answer: Store your leroy project in a separate repository, create a development and a development-stable branch. Setup a separate job in your build server to fetch your development branch to deploy your application to a build environment to validate your deployment is working. Upon success, merge development to development-stable. Use development-stable to deploy to dev, qa on release, merge your development-stable branch to master just like you would your code and deploy your code and deployment component (leroy) from master to production like a big boy.
Are you working with integrating deployment code into a life-cycle model and having issues ? Ask us, we probably have seen the issue and can give a quick answer, may save you some time !