jueves, enero 24, 2013

Jenkins Description Setter Plugin for Improving Continuous Delivery Visibility

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 Jenkins description 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:

\[INFO\]         from version 0\.0\.1-SNAPSHOT to (.*)

Take a look at next fragment of build log file:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building hello 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- versions-maven-plugin:2.0:set (default-cli) @ hello ---
[INFO] Searching for local aggregator root...
[INFO] Local aggregation root: /jobs/helloworld-inital-build/workspace
[INFO] Processing com.lordofthejars.helloworld:hello
[INFO]     Updating project com.lordofthejars.helloworld:hello
[INFO]         from version 0.0.1-SNAPSHOT to 1.0.43
Props: {project.version=1.0.43, project.artifactId=hello, project.groupId=com.lordofthejars.helloworld}

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,
Yellow diamonds in the light, And we're standing side by side, As your shadow crosses mine (We Found Love - Lindsey Stirling)
Music: http://www.youtube.com/watch?v=0g9poWKKpbU

5 comentarios:

Frederic Conrotte dijo...

Indeed, very useful. If you are interested in doing Continuous Delivery with Jenkins, I strongly recommand you this presentation:

Alex Soto dijo...

Thank you very much for the link ;) I already watched it, in fact I met personally John and we talked about it. Thank you very much for reading my blog and suggesting links.


Sandeep Bhandari dijo...

Nice addition and good share.
Error pages in tomcat

Libin Huang dijo...

20160509libinoakley sunglasses
louis vuitton handbags
toms outlet
nike huarache
coach outlet store
oakley sunglasses
burberry sunglasses
swarovski crystal
michael kors uk outlet
tiffany outlet
michael kors outlet
beats by dre
coach outlet
true religion jeans
michael kors handbags wholesale
michael kors bags
mulberry uk
soccer jerseys wholesale
hollister uk
dior outlet
ferragamo shoes
hermes bags
michael kors outlet
christian louboutin outlet
mulberry handbags
true religion jeans
ralph lauren outlet
tiffany jewelry
cartier outlet
cheap nba jerseys
ralph lauren,polo ralph lauren,ralph lauren outlet,ralph lauren italia,ralph lauren sito ufficiale
louis vuitton handbags
polo ralph lauren
burberry outlet online
babyliss flat iron

Gege Dai dijo...

asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
nike air huarache
ferragamo shoes
michael kors outlet online
ray ban sunglasses
oakley sunglasses
replica watches
ray-ban sunglasses
air max 90
michael kors uk outlet
coach outlet store
hollister clothing store
fitflops sale clearance
michael kors outlet online
ray ban sunglasses
michael kors clearance
ferragamo outlet
longchamp outlet
michael kors outlet
pandora outlet
cheap replica watches
pandora outlet
timberland boots
burberry sunglasses
michael kors factory outlet
mulberry outlet
michael kors outlet
reebok outlet store
true religion outlet
nike air max 90
michael kors outlet
gucci sunglasses uk
true religion outlet
celine outlet online
prada sunglasses

Donate If You Can and Find Post Useful