Build Pipelines with Jenkins/Hudson

DZone 's Guide to

Build Pipelines with Jenkins/Hudson

· DevOps Zone ·
Free Resource

This article is an extract from the upcoming book Jenkins: The Definitive Guide, to be published in the coming months with O'Reilly..

One of the more interesting plugins to emerge over the last few months is the Build Pipeline plugin, written by the folks at Centrum Systems. The Build Pipelines plugin takes the idea of build promotion further, and helps you design and monitor deployment pipelines. A deployment pipeline is a way of orchestrating your build through a series of quality gates, with automated or manual approval processes at each stage, culminating with deployment into production.

The Build Pipeline plugin provides an alternative way to define downstream build jobs. A build pipeline, unlike conventional downstream dependencies, is considered to be a linear process, a series of build jobs executed in sequence.

To use this plugin, start by configuring the downstream build jobs for each build job in the pipeline, using the 'Build other projects' field just as you would normally do. The Build Pipelines plugin uses the standard upstream and downstream build configurations, and for automatic steps this is all you need to do. However the Build Pipeline plugin also supports manual build steps, where a user has to manually approve the next step. For manual steps, you also need to configure In the Post-build Actions of your upstream build job: just tick the 'Build Pipeline Plugin -> Specify Downstream Project', select the next step in your project, and tick the 'Require manual build executor' option, as shown here.

Configuring a manual step in the build pipeline

>Once you have set up your build process to your satisfaction, you can configure the build pipeline view. You can create this view just like any other view.

Creating a Build Pipeline view

There is a trick when it comes to configuring the view, however. At the time of writing, there is no menu option or button that lets you configure the view directly. In fact, you need to enter the URL manually. Fortunately, this is not difficult: just add "/configure" to the end of the URL shown when you are displaying this view. For example, if you have named your view "phoenix-build-pipeline", as shown here, the URL to configure this view would be "http://my_hudson_server/view/phoenix-build-pipeline".

Configuring a Build Pipeline view

The most important thing to configure in this screen is the initial job. This marks the starting point of your build pipeline. You can define multiple build pipeline views, each with a different starting job. You can also configure the maximum number of build sequences to appear on the screen at once.

Once you have configured the starting point, you can return to the view to see the current state of your build pipeline. Jenkins displays the successive related build jobs horizontally, using a color to indicate the outcome of each build. There is a column for each build job in the pipeline. Whenever the initial build job kicks off, a new row appears on this page. As the build progresses through the successive build jobs in the pipeline, Jenkins will add a colored box in the successive columns, indicating the outcome of each stage. You can click on the box to drill down into a particular build result for more details. Finally, if a manual execution is required, a button will be displayed where the user can trigger the job.

Configuring a Build Pipeline view

This plugin is still relatively new, and does not integrate with all of the other plugins we have seen here. In particular, it is really designed for a linear build pipeline, and does not cope well with branches or parallel build jobs. Nevertheless, it does give an excellent global vision of a build pipeline.


From http://weblogs.java.net/blog/johnsmart/archive/2011/03/10/build-pipelines-jenkinshudson

java, tools & methods

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}