Skip to main content
Transform your testing process with: Company-wide Licences, Test Observability & App Percy

Integrate Percy with Jenkins

Integrate Percy with Jenkins, a popular CI-CD tool

Follow these steps to integrate Percy with Jenkins:

Configuring Jenkins environment variables

Start by configuring PERCY_TOKEN, our project-specific, write-only API token. It can be found in your Percy project settings.

Depending on how you have Jenkins configured, there are a few options for configuring environment variables. Two Jenkins plugins that allow you to configure environment variables include the Build Env Propagator Plugin and the EnvInject plugin.

Alternatively, you could export the variables as part of the build script:

bash
Copy icon Copy snippet

Commit, branch, and pull request information

If you’re using the default GitHub Branch Source Plugin or the equivalent Bitbucket Branch Source Plugin Percy will auto-detect the commit, branch, and pull request details for you from the environment variables the plugins provide.

If you’re not using one of these plugins, please review our environment variables docs page, and configure your environment to include PERCY_COMMIT, PERCY_BRANCH, and PERCY_PULL_REQUEST.

Run your tests

Now with your environment configured, when you run your Percy snapshots via your test suite or another mechanism, your Percy build will be created with the correct meta-data.

bash
Copy icon Copy snippet

Parallelized build processes

If you parallelize your build across multiple processes or nodes, PERCY_PARALLEL_TOTAL and PERCY_PARALLEL_NONCE will need to be configured too. If you’re using one of the Branch Source plugins mentioned above, PERCY_PARALLEL_NONCE will automatically be configured to the BUILD_TAG. Please contact us to discuss how to set these variables to support parallelized build processes.

Keep your Percy token secret.

Anyone with access to your Percy token can add builds to your project, though they cannot read data. If your code is public, do not commit the PERCY_TOKEN to your code.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy