For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add a Jenkins connector

Documentation for the provisioning of Jenkins Registry connectors.

You can perform Continuous Integration (CI) in Harness using the CI module and CI pipelines. If you use Harness Continuous Delivery (CD) but not Harness CI, you can still perform CI using the Jenkins step in a CD stage.

You connect Harness to Jenkins using a Harness Jenkins connector. This connector allows you to run Jenkins jobs in Jenkins steps.

This topic shows you how to add a Jenkins connector to Harness.


What you will learn from this topic


Before you begin

  • Jenkins permissions: The user account for this connection needs Read access at the Overall level and Build access at the Job level on the Jenkins server. For details on configuring these permissions, see Jenkins Matrix-based security from Jenkins.

  • Jenkins API token (for token-based authentication): Go to http://JENKINS_IP_ADDRESS/jobs/me/configure on your Jenkins server to check or generate your API access token. The Harness Jenkins connector sends this token as part of the HTTP header.

  • Okta or two-factor authentication (2FA): If you use Okta or 2FA for connections to Jenkins, select API Token for Authentication when you configure the connector.

SAML authentication

Harness supports SAML authentication for Jenkins connections.


Add a Jenkins connector

You can add a Jenkins connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account. You can also add a Jenkins connector directly when you configure the Jenkins step in a pipeline.

Follow the interactive guide below for a step-by-step walkthrough:

spinner
Add a Jenkins connector in Harness

Perform the following steps to add a Jenkins connector:

  1. Open your Harness project.

  2. In Project Settings, select Connectors.

  3. Click New Connector, then click Jenkins.

Overview

  1. In Name, enter a name for the connector. Optionally, add a description and tags. Click Continue.

Details

  1. Enter the URL of the Jenkins master or controller:

    • If you use the Jenkins SaaS (cloud) edition, find the URL in your browser's address bar.

    • If you use the standalone edition of Jenkins, navigate to System in Manage Jenkins, and find the URL under Jenkins Location.

    Jenkins Location field in Manage Jenkins showing the Jenkins server URL
  2. In Authentication, select one of the following options to authenticate with the Jenkins server:

    • Username and Password/API Token: Enter the username for the account. Select or create a Harness Encrypted Text secret using your Jenkins API token or password. Go to Before you begin to generate or check this token.

    • Bearer Token (HTTP Header): Select or create a Harness Encrypted Text secret using the OpenShift OAuth access token. This option applies only to Jenkins servers hosted or embedded in an OpenShift cluster that use this authentication method. Go to Authentication from OpenShift to configure OAuth authentication for a Jenkins server hosted on OpenShift.

    Click Continue.

Delegates Setup

  1. In Delegates Setup, use any delegate or enter tags for the specific delegates that you want to allow to connect to this connector. Click Save and Continue.

Connection Test

  1. Click Finish after the connection test succeeds. The connector is listed in Connectors.

Sample YAML

The following example shows a YAML for the Jenkins connector created in this guide.

YAML - Jenkins connector

Next steps

Last updated

Was this helpful?