O'Reilly logo

Jenkins: The Definitive Guide by John Ferguson Smart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Build Triggers

Once you have configured your version control system, you need to tell Jenkins when to kick off a build. You set this up in the Build Triggers section.

In a Freestyle build, there are three basic ways a build job can be triggered (see Figure 5-23):

  • Start a build job once another build job has completed

  • Kick off builds at periodical intervals

  • Poll the SCM for changes

There are many ways that you can configure Jenkins to start a build job

Figure 5-23. There are many ways that you can configure Jenkins to start a build job

Triggering a Build Job Once Another Build Job Has Finished

The first option lets you set up a build that will be run whenever another build has finished. This is an easy way to set up a build pipeline. For example, you might set up an initial build job to run unit and integration tests, followed by another separate build job to run more CPU-intensive code quality metrics. You simply enter the name of the preceding build job in this field. If the build job can be triggered by several other build jobs, just list their names here, separated by commas. In this case, the build job will be triggered once any of the build jobs in the list finish.

There is a symmetrical field in the Post-build actions section of the preceding build job called (appropriately enough) “Build other projects”. This field will be automatically updated in the corresponding build jobs whenever you modify the “Build after other projects are built” field. However, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required