Create a Jenkins task
This topic describes how to create a Jenkins Build and Multibranch Pipeline Scan tasks in Release, enabling integration with Jenkins to trigger builds and deployments.
Set up a Jenkins Server
To set up a Jenkins Server:
-
Select Configuration> Connections from the sidebar, and click
next to the Jenkins: Server.
noteYou can configure Jenkins servers on a folder level in Connections tab of the desired folder.
-
In the Title field, enter the name of the Jenkins server. This name will display in Jenkins tasks.
-
In the URL field, enter the URL of the Jenkins server.
-
Two authentication methods are available, do one of the following:
- Type the login Username and Password. Or
- Type the login Username and the API token.
-
Click Test to verify a successful connection with Jenkins server.
-
Click Save.
Create a Jenkins Task
With the Release Jenkins task, you can run a Jenkins job (Build and Multibranch Pipeline Scan) that is triggered when the task becomes active. The task will complete when the job completes successfully on the Jenkins server; otherwise, the task will fail.
The options for the Jenkins task are:
Task | Option | Description |
---|---|---|
Build, Scan Multibranch Pipeline | Server | The Jenkins server where Release connects. You can configure Jenkins servers in Connections under the Configuration group of the navigation pane. Jenkins servers can also be configured at the folder level in the Connections tab of the desired folder. |
Build, Scan Multibranch Pipeline | Username | Optional: The username to use when connecting to the Jenkins server. Use this property to override the username configured on the Jenkins server. |
Build, Scan Multibranch Pipeline | Password | Optional: The password to use when connecting to the Jenkins server. Use this property to override the password configured on the Jenkins server. |
Build, Scan Multibranch Pipeline | API Token | Optional: The API token to use when connecting to the Jenkins server. Use this property to override the API token configured on the Jenkins server. |
Build, Scan Multibranch Pipeline | Job Name | The name of the job to be triggered. This job must be configured on the Jenkins server. If the job is located in one or more Jenkins folders, add a job segment between each folder. For example, for a job located at Applications/web/my portal, use Applications/job/web/job/my portal. |
Build | Job Parameters | If the Jenkins job requires parameters, provide them one per line. The names and values of the parameters should be separated by the first = character. |
Build | Branch | The branch name for which the build will be triggered. For a Freestyle project, use master as the branch name. |
Build | Fail unstable build | Turn this toggle button on to fail the Release task if the Jenkins job becomes unstable, ensuring only successful builds lets the release proceed. This toggle button is turned off by default. |
The output properties of the Build task are Build Number and the Build Status. They can be stored in a variable, for example ${buildNumber}
and ${buildStatus}
.
In the release flow editor, Jenkins tasks are marked with a blue border.
For more information about using Jenkins with Release, see Using the Release plugin for Jenkins.
Build
This task triggers a specific Jenkins job. It runs the steps defined in the job configuration.
Scan Multibranch Pipeline
This task scans a multibranch pipeline. It is used to detect and process changes in the branches of a source code repository to automatically create or update corresponding pipeline jobs.
Change the poll interval
Release will schedule the execution of the scripts and poll for the availability of a resource according to a configurable interval. The default poll interval is 5 seconds. You can change this behavior by configuring the interval in the XL_RELEASE_SERVER_HOME/conf/xl-release.conf file. See the configuration options for using scripts.
Changing the default polling interval will affect all custom script tasks, including the Jenkins task.