GitLab CI

👍

Covered in this doc

Integrating Percy with your GitLab CI environment

This doc will walk you through implementing Percy into your GitLab CI environment. See separate docs to integrate with GitLab.com.

Configuring environment variables


Start by configuring PERCY_TOKEN, our project-specific, write-only API token. It can be found in your Percy project settings and can easily be added to your GitLab build pipeline config or agent hooks.

Shown below is a minimal CI config that has the necessary variables to make Percy work smoothly. If you're using docker in GitLab's CI, make sure these are passed into your container:

---
test:
  variables:
    - GITLAB_CI
    - CI_COMMIT_SHA
    - CI_COMMIT_REF_NAME
    - CI_JOB_ID
    - CI_SERVER_VERSION
    - CI_MERGE_REQUEST_IID
    - PERCY_TOKEN

To configure environment variables, navigate to your GitLab repository, then go to Settings > CI/CD > and then expand the Variables section.

Then set PERCY_TOKEN to the write-only token from your Percy project. This token can be found in each Percy project's settings.

977

📘

Keep your Percy token secret

Anyone with access to your token can add builds to your project, though they cannot read data.


What's next

If you haven't installed and configured an SDK or source code integration, those are your next steps to getting started with visual testing.