Native CI integration

3 minute readDeveloper productivityExtensibility

CI integration allows you to trigger a CI job as a release or pipeline task. These jobs become available as pipeline tasks after completing a one-time CloudBees CI controller configuration. Using the CloudBees CD/RO Jenkins plugin, you can also configure CI jobs as release tasks.

The Jenkins interactive input support is depended upon the Jenkins plugin configuration.

Configuring CloudBees CI controllers

Connections to individual CloudBees CI controllers, and optionally CloudBees CI operations centers, can be configured with a one-time CloudBees CD/RO setup. CloudBees CD/RO can call a CI job managed by the controllers as if it is native, automatically populating the job data and parameters from CI into CloudBees CD/RO.

To configure a CloudBees CI controller via the CloudBees CD/RO API, refer to CI configuration.

To configure CloudBees CI controllers:

  1. From the CloudBees CD/RO main menu, select Administration  Configurations.

  2. Select CI configurations from the left-hand menu to display the CI configuration list.

  3. Select New. From here, create a new configuration or copy an existing one.

    By default, a CloudBees CI controller configuration is created.

    If the selected Type is CloudBees CI operations center, check whether you want to use this operations center as the default. If checked and a default is already configured, it is replaced by this one. All CloudBees CI controllers in that operations center are automatically discovered and populated into the configuration list.

    CloudBees CI cofiguration
  4. Under Credential type select either Local credential or External credential.

    1. For a local credential, type the user name and API token or password.

    2. For an external credential, select the credential project to use, and then the credential you want to use.

  5. Optionally, select the option to test the connection to the CI configuration server.

  6. Select OK when finished.

  7. If the new configuration is for the CloudBees CI operations center:

    1. Expand the list to discover all individual CloudBees CI controllers.

    2. Navigating into the list, select Copy for the controller you wish to move into the CI configurations list.

      Copy the controller

      A New CI configuration dialog displays for that controller. Since Reuse the same credentials from the Operation Center CI Configuration is selected, the configuration pre-populates with sign-in credentials.

    3. Select OK to save.

Whether added directly or selected from the CloudBees CI operations center, the new configuration is added to the CloudBees CI controller configurations list and is available for CI Job tasks in CloudBees CD/RO pipelines.

Adding a CI Job as a pipeline or release task

Define a CloudBees CD/RO pipeline task as a CI Job specifying the CI configuration and other details about the CI job. Refer to Pipeline Tasks for general information about creating tasks.

To add a CI job via the CloudBees CD/RO API, refer to the createTask command.

When upgrading to CloudBees CD/RO v10.1 from an earlier release the existing URLs configurations are hardcoded with the /cjoc path component

Use these steps to create a CI Job as a task in an existing CloudBees CD/RO pipeline or release.

  1. Select Add task to add CI job to pipeline or release stage.

  2. Enter a task name in the New Task field.

  3. Click the Select Task Type link.

  4. Select CI Job from the list of task types.

  5. Click the Define link.

  6. Choose a CI Job from the Select CI Configuration menu.

  7. Select OK.

    Edit task

Viewing pipeline build data

Build details for CI jobs triggered by CloudBees CD/RO are sent back as the job runs.

Use the getCIBuildDetail command to get build details via the API.

To view the information:

  1. Access the Pipeline runs one of following ways:

    • From the Release editor or Pipeline editor select the Pipeline runs tab.

    • Navigate to Release Orchestration  Pipeline Runs.

      Build Data for CloudBees CD/RO pipelines triggered by CloudBees CI are denoted on the Pipeline Runs list with the Jenkins logo.
  2. Select the Jenkins Buid data logo of the Pipeline Runs to be viewed. The CI Build Data screen displays.

    CI Build Data
    Figure 1. CI Build Data
  3. Select theDetails arrow Details arrow. for the run instance to be viewed. The View CI Build screen displays the console output summary for the CloudBees CI job. This screen also includes build artifacts and test results.

    CI Build Data
    Figure 2. CI Build Data

Known limitations

This section describes situations to be aware of when calling CI jobs from CloudBees CD/RO.

Infinite triggering loop

Care must be taken so that a given CloudBees CD/RO job doesn’t invoke a CI job having a post-build action that triggers the same CloudBees CD/RO pipeline; otherwise, an infinite triggering loop ensues.

Triggering the same CI job multiple times

During a CloudBees CD/RO pipeline run, a CloudBees CI job cannot be triggered more than once if there is already another CloudBees CI build waiting in the queue, unless the CloudBees CI job is configured with unique parameters.

CloudBees CD/RO pipeline run returns false success

The CloudBees CD/RO pipeline waits indefinitely instead of completing with an error if the target CI job is cancelled or aborted while waiting in the queue.