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.
Before you can use the Jenkins plugin, prepare your environment:
Install the Jenkins server on your network (but not necessarily on the PulseUno server).
Define a job on your Jenkins server that the plugin will run.
(Optional) Add build parameters to the job so that details about the stream/branch 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.
The following table describes the build parameters:
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.
Configure Jenkins plugin
Because Jenkins manages its own workspaces, you can add the Jenkins plugin to a chain that does not populate a workspace.
To configure the Jenkins step:
Add the Jenkins step to a chain, as described in Create chains.
Enter the plugin configuration details:
Field Description Title (Optional) Rename the plugin step. Jenkins job location
Enter the URL of the continuous integration server, including the job name.
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:
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.
Note: We recommend using the API token instead of a password, but you can use either. To find your API token, log in to your Jenkins server and open your personal configuration page. For details, see the Jenkins documentation.
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. For details, 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.
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.
Change the output log length
To reduce the database storage requirements for output logs, decrease the number of lines stored in the database.
By default, the last 100 lines from the Jenkins log are displayed in a chain run's output log and stored. For details, see View chain runs.
To change the number of displayed and stored lines:
Open the Jenkins property file:
Modify the value of the jenkins.console.lines.count property. For example, set it to 20.