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
How to check the Jenkins permissions and authentication requirements before you connect Harness to Jenkins.
How to add a Jenkins connector to a Harness project so you can run Jenkins jobs from a pipeline.
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/configureon 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.
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:
Perform the following steps to add a Jenkins connector:
Open your Harness project.
In Project Settings, select Connectors.
Click New Connector, then click Jenkins.
Overview
In Name, enter a name for the connector. Optionally, add a description and tags. Click Continue.
Details
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 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
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
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.
Next steps
Run Jenkins jobs in CD pipelines: Configure a Jenkins step to run Jenkins jobs in your pipeline.
Last updated
Was this helpful?