Skip to main content
Version: Early Access

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:

  1. Select Configuration> Connections from the sidebar, and click image next to the Jenkins: Server.

    note

    You can configure Jenkins servers on a folder level in Connections tab of the desired folder.

  2. In the Title field, enter the name of the Jenkins server. This name will display in Jenkins tasks.

  3. In the URL field, enter the URL of the Jenkins server.

  4. 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.
  5. Click Test to verify a successful connection with Jenkins server.

  6. Click Save.

    Authentication using Username/Password

    Authentication using Username/API Token

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:

TaskOptionDescription
Build, Scan Multibranch PipelineServerThe 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 PipelineUsernameOptional: 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 PipelinePasswordOptional: 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 PipelineAPI TokenOptional: 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 PipelineJob NameThe 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.
BuildJob ParametersIf the Jenkins job requires parameters, provide them one per line. The names and values of the parameters should be separated by the first = character.
BuildBranchThe branch name for which the build will be triggered. For a Freestyle project, use master as the branch name.
BuildFail unstable buildTurn 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.

Build

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.

Scan multibranch

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.

note

Changing the default polling interval will affect all custom script tasks, including the Jenkins task.