jueves, enero 24, 2013

In Continuous Delivery each build is potentially shippable. This fact implies among a lot of other things, to assign a none snapshot version to your components as fast as possible so you can refer them through all the process. I suggest creating a release branch, assign the version to the project and then start the typical pipeline (compile, tests, code quality ...) steps to release branch.

If you are using Jenkins, your build job screen will look something like:

Note that we have released the project many times, but there is no quick way to know exactly which version has been constructed in build number 40. To avoid this problem and having a quick overview of which version has been executed in each build job instance, we can use Jenkinsdescription setter plugin. This plugin sets the description for each build, based upon a regular expression of the build log file.

So your build job screen will look something like:

Much better, now we know exactly the result of a build job and which product version has been generated.

So first step is installing the plugin by simply going to:

Jenkins -> Manage Jenkins -> Manage Plugins -> Available

After installation you can open Build Job configuration screen and add a post-build action called "Set build description". Then add a regular expression for extracting the version number. In this case the regular expression is:

At line 12 we are logging the final version of our product for current pipeline execution, so we create a regular expression which parses that line and the part between brackets are used as decorator.

Depending on log traces the regular expression will differ from this one. In this case, we are always using the same SNAPSHOT version in development and only when product is going to be released (this could be 3 times per day or every night) the final version is generated and set.

Hope this plugin helps you to make your builds more clear.

We keep learning,
Alex.

Yellow diamonds in the light, And we're standing side by side, As your shadow crosses mine (We Found Love - Lindsey Stirling)

5
comentarios:

Indeed, very useful. If you are interested in doing Continuous Delivery with Jenkins, I strongly recommand you this presentation:http://www.devoxx.com/display/DV11/Jenkins++From+Continuous+Integration+to+Continuous+Delivery