Jenkins

Use the Jenkins bundled plugin to run a Jenkins job on a remote Jenkins server. For example, the plugin can trigger a continuous integration build against each changeset as the changesets are delivered, and report the build time.

Prerequisites

Before you can use the Jenkins plugin in a chain, ensure that the following prerequisites are fulfilled:

  • The Jenkins server must be installed on your network (but not necessarily on the PulseUno server).

  • Define a job on your Jenkins server that the plugin will run.

Optionally add build parameters to the job so that details about the Dimensions CM stream and changeset are available in your build.

Alternatively, allow the Jenkins plugin to make any configuration changes to the Jenkins job automatically (no manual changes to your Jenkins job are needed).

If you add the build parameters manually, select the option This build is parameterized on your Jenkins job configuration page, and add each build parameter as a String Parameter. The Default Value and Description values in Jenkins are not important.

Jenkins build parameter Description
cmkey

An opaque value that uniquely identifies the build run to the Jenkins plugin.

The Jenkins plugin can automatically add this parameter to your Jenkins job, and no manual job configuration is needed.

repo (Optional) An opaque value that is different for each SCM repository.
stream (Optional) The name of the stream or project to which there was a delivery.
version (Optional) The stream or project version that the delivery created.
changeset (Optional) The repository (forest) version of the changeset for the delivery.

Back to top

Configuration

Because Jenkins manages its own workspaces, you can add the Jenkins plugin to a chain that does not populate a workspace.

When you add the Jenkins plugin step to a chain, specify the following configuration details:

Field Description
Title Enter a name for this step in the chain.
Jenkins job location Enter the URL of the continuous integration server, including the job name.
Username Enter a Jenkins username. May be required if you are using Jenkins authentication.
Password Enter the password or API token of the Jenkins user. May be required if you are using Jenkins authentication.
Automatically add build parameters to Jenkins job

(Optional) Automatically reconfigure the Jenkins job to add the mandatory build parameter cmkey.

You can also add parameters manually if you prefer that the Jenkins plugin does not touch your job. See Prerequisites.

Record Jenkins job build result (Optional) Specifies whether the Jenkins plugin should monitor the job and record its state it completes.
Check Jenkins job status every (seconds) If the Record Jenkins Job build result option is selected, specifies how often the Jenkins plugin checks if the job has completed.

Tip: We recommend using the API token instead of a password, but you can use either in the Jenkins plugin. To find the value of the API token for a Jenkins user, log in to your Jenkins server and open the user configuration page:

  1. Select your name at the top-right of the Jenkins page.

  2. From the Actions menu, select Configure.

  3. Click Show API Token.

If your Jenkins job requires a build authentication token before the job can be triggered, add the token to the end of the Jenkins URL, for example:

http://<hostname>:<port>/jenkins/job/MyProject/?token=buildtoken

Jenkins plugin behavior:

  • The plugin uses the parameters after the question mark in the build request URLs that are sent to the Jenkins server.
  • The plugin supports freestyle and pipeline jobs.

Back to top

Change the number of lines in the output log

By default, the last 100 lines from the Jenkins log are displayed in the output log of a chain run and stored in the database. For details, see View chain run details.

Tip: To reduce the database storage requirements for output logs, decrease the number of lines stored, for example, 20.

To change the number of lines that are displayed and stored:

  1. Open the Jenkins property file:

    ${dataDir}/conf/experts/com.serena.starlight/jenkins/jenkins-pulse-expert.properties

  2. Modify the value of this property: jenkins.console.lines.count

Back to top

See also: