Jenkins

Jenkins is an open source automation server which enables developers to build, test, and deploy software.

Integrating Jenkins with Cortex allows you to:

How to integrate Jenkins with Cortex

Step 1: Install the Cortex Deployer app

This integration uses the Cortex Deployer app, an open-source app that makes it easier for teams to push information about deploys to Cortex. This app leverages Cortex's deploy REST endpoint.

Step 2: Add a step to your Jenkins pipeline

Jenkins secrets

To use the Cortex Deployer app, you will need the x-cortex-tag and a Cortex API token. In the example below, both are defined as Jenkins secrets.

Jenkinsfile

To push information to Cortex about a deploy event, add a step to your Jenkins pipeline. Below is a snippet of what a Jenkinsfile may look like.

pipeline {
    agent any
    environment 
    stages {
        stage('update-cortex') { 
            steps {
                sh "docker run cortexapp/deployer:0.2 -i \"Jenkins deploy\" -k $CORTEX_API_TOKEN -s $GIT_COMMIT -t DEPLOY -e Prod -c '' -g $CORTEX_TAG" 
            }
        }
    }
}

For more details about the options passed to the Docker image, please refer to the Deployer repository.

Using the Jenkins integration

View Jenkins deploys on entity pages in Cortex

After you configure the integration, you will see data about Jenkins deploys in an entity's details page:

  • On the entity overview, Jenkins deploys will appear under the Latest events section.

  • In the entity's sidebar, click Events to see a full list of events for the entity, including deploy events from Jenkins.

  • In the entity's sidebar, click CI/CD > Deploys to see data from the Cortex deploys API, including Jenkins deploys.

Kick off a Jenkins pipeline in a Cortex Workflow

You can use a Workflow to kick off a Jenkins pipeline. See this docs page for more information.

See Jenkins data in Eng Intelligence

Since the Jenkins integration uses Cortex's deploys API endpoint, Jenkins data is included in Eng Intelligence deploy metrics. Learn more about Eng Intelligence in the docs.

Still need help?

The following options are available to get assistance from the Cortex Customer Engineering team:

  • Email: [email protected], or open a support ticket in the in app Resource Center

  • Chat: Available in the Resource Center

  • Slack: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a :ticket: reaction to a question in Slack, and the team will respond directly.

Don’t have a Slack channel? Talk with your Customer Success Manager.

Last updated

Was this helpful?