This Bamboo customer story is the sixth of an 8-part blog series about why so many developers adopt continuous integration written by our guest blogger, John Ferguson Smart. Last time we talked about optimizing Continuous Integration to push build artifacts, and this week we cover automating the staging and production deployments using Maven, Jira, and Bamboo.
This Bamboo customer story is the sixth of an 8-part blog series about why so many developers adopt continuous integration written by our guest blogger, John Ferguson Smart.
John is a consultant and trainer specialising in Build Automation, Enterprise Java, Web Development, and Open Source technologies, currently based in Wellington, New Zealand.
Automating the staging and production deployments
Testing intermediate builds is one thing, moving to General Availability and production deployments are a whole other subject. Steve and Simon, the developers in story 5, also had this issue to grapple with as prior to using Bamboo this was an entirely manual process. When they moved to using Bamboo for Continuous Integration they also upgraded their issue tracker to Jira which made for a very pleasant surprise.
The pain of manual builds
Originally, this was a manual process, requiring a developer to run the mvn release:prepare and mvn release:perform commands from the command line. Maven would prompt for the next version number, which had to be entered by hand.
Preparing Maven, Jira and Bamboo
Since their project uses Maven, he uses the Maven Release Plugin to help manage the build promotions. This powerful plugin checks that all the latest changes had been committed to Subversion, creates a new tag in the Subversion repository with a label matching the next release number, and updates the Maven project version number. In a second phase, the tagged code is checked out, built, tested and deployed to the Nexus repository, ready to be used during the staging deployment.
Practice makes perfect
With a little work, Steve was able to automate the process and create a series of Bamboo build plans that authorized users can now use to deploy to the right environment with the click of a button. In Bamboo, there are now two special “release” build plans, one for staging and one for production. The staging and production build plans are run on remote agents, directly on the staging and production servers. Each build plan can only be executed by people authorized to deploy to staging and production respectively. These build plans propose a list of available Jira versions for deployment, and the user simply needs to choose the right version number to kick off a full-blown deployment.
To get around the Subversion bug mentioned above, Steve wrote a Groovy script that automates the whole process, including the work-around if the Subversion issue occurs.
Now, whenever a release is ready to go onto staging or production, the build promotion process is as simple as clicking on the corresponding link in the list of available version numbers.
Last time we talked about optimizing Continuous Integration to push build artifacts; stay tuned for the next Bamboo customer story when we talk about clever tools to optimize Continuous Integration.
What’s your adoption story? Tweet Atlassian or leave a comment below about how and why you adopted CI.