---
source_url: "https://applitools.com/docs/eyes/integrations/ci-cd/jenkins"
title: "Working With Jenkins | Applitools Documentation"
mirrored_at: 2026-08-11T15:38:45.853Z
host: applitools.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/applitools.com/docs/eyes/integrations/ci-cd/jenkins"
---

> **Original source:** https://applitools.com/docs/eyes/integrations/ci-cd/jenkins

## Configuring the Applitools CI/CD Integration[​](#configuring-the-applitools-cicd-integration "Direct link to Configuring the Applitools CI/CD Integration")

Navigate to the Jenkins project configuration, go to the Execute shell window and enter the following:

```
export APPLITOOLS_BATCH_ID=$(echo ${GIT_COMMIT})export APPLITOOLS_API_KEY= "your api key"
```

## Jenkins Plugin[​](#jenkins-plugin "Direct link to Jenkins Plugin")

### Installing the Applitools eyes Jenkins plugin[​](#installing-the-applitools-eyes-jenkins-plugin "Direct link to Installing the Applitools eyes Jenkins plugin")

Go to the project in Jenkins that you want to integrate. Then click on "Manage Jenkins" (1) and then go to "Manage Plugins" (2).

![Manage Jenkins](https://applitools.com/docs/assets/images/jenkins.manage-jenkins-eeb167605cf46ed6c25eb3031ba84df1.png)

Then go to the "Available" plugin list (3) and search for "Applitools" (4). After the search, install the "Applitools Eyes Plugin" (5) without restart (6).

![Plugin Steps](https://applitools.com/docs/assets/images/jenkins.applitools-plugin-steps-a5fe47cb08bab28e0871d0730a644f64.png)

### Project configuration - Free style project[​](#project-configuration---free-style-project "Direct link to Project configuration - Free style project")

Go back to your Jenkins project, and click on "Configure" (7).

![Configure](https://applitools.com/docs/assets/images/jenkins.configure-2b87c4e96fc3137a4c46c80b803d249d.png)

Now you can find under "Build Environment" an option titled "Applitools support" (8). If you're using the public cloud, leave the URL as it is, but if you're using a private cloud, change the URL according to your server's address and press "Save".

![Build Env](https://applitools.com/docs/assets/images/jenkins.build-env-b1907440e840c8b94e7e266466b4db04.png)

### Project Configuration[​](#project-configuration "Direct link to Project Configuration")

To use the Applitools plugin in a pipeline project, you need to add the Applitools() directive and put your run code in a block. Following is a script example:

```
node {	stage('Applitools build') { 		Applitools() {			sh 'mvn clean test'		}	}}
```

If you are using a dedicated Applitools Eyes server, you should update the Applitools URL accordingly inside the Applitools directive. For example:

```
node {	stage('Applitools build') { 		Applitools('https://myprivateserver.com') {			sh 'mvn clean test'		}	}}
```

### Linking the Applitools batch ID with the relevant Jenkins Job[​](#linking-the-applitools-batch-id-with-the-relevant-jenkins-job "Direct link to Linking the Applitools batch ID with the relevant Jenkins Job")

The batch-ID parameter is passed through an environment variable called `APPLITOOLS_BATCH_ID` to the executed tests, and the build name is passed through an environment variable called `APPLITOOLS_BATCH_NAME`.

The next time you build a project with Jenkins, you will be able to get the Applitools test results integrated into your Jenkins Build Report, as can be seen below:

![Plugin](https://applitools.com/docs/assets/images/jenkins.plugin-5a46415388743b3d90b4f9893e9946fe.png)

### Enabling Applitools logs in Jenkins[​](#enabling-applitools-logs-in-jenkins "Direct link to Enabling Applitools logs in Jenkins")

If you are using a Jenkinsfile, add a `post` block to archive the Applitools logs after the run:

```
post {    always {        archiveArtifacts artifacts: 'applitools-logs/*.log', allowEmptyArchive: true    }}
```

If you are configuring this in the Jenkins UI, use the "Archive the artifacts" post-build action:

-   Go to Post-build Actions.
-   Select Archive the artifacts.
-   In "Files to archive", enter: `applitools-logs/*.log`.

note

If your Jenkins test step runs inside Docker, the Applitools log files are created inside the container filesystem and may disappear when the container exits. Mount the container log directory to the host workspace so Jenkins can archive the files after the build.

Example Docker command:

```
docker run \  -e APPLITOOLS_SHOW_LOGS=true \  -e APPLITOOLS_LOG_DIR=/usr/src/app/logs \  -v ${WORKSPACE}/applitools-logs:/usr/src/app/logs \  your-image-name
```

Adjust `${WORKSPACE}` to your Jenkins workspace path.