Configure Percy environment variables in Buildkite
Percy is designed to integrate with your tests and CI environment. To enable Percy, the token environment variable must be configured in your CI service:
PERCY_TOKEN: The Percy repo write-only API token. This is unique for each Percy repository.
Buildkite pipeline setup
Buildkite provides an easy way to set environment variables in your build pipeline config or agent hooks:
In your Buildkite pipeline, go to Settings > Steps > Environment Variables.
PERCY_TOKEN to the write-only token from your Percy repo. This token can be found in each Percy repo's settings.
IMPORTANT: Keep your Percy token secret. Anyone with access to your token can consume your account quota, though they cannot read data.
Setup for docker-compose
If you use Docker containers in your Buildkite builds, you need to pass some environment variables in to your containers for Percy's client library to detect the environment correctly.
Add this to your
environment: - BUILDKITE - BUILDKITE_COMMIT - BUILDKITE_BRANCH - BUILDKITE_PULL_REQUEST - BUILDKITE_BUILD_ID - PERCY_TOKEN
By leaving the value blank, Docker will pass through the value from the host Buildkite environment.
Next step: integrate with tests
You're done with setup---the last step is to integrate Percy into your tests and run them. Just choose your client library:
- Storybook for React
- Storybook for Angular
- Storybook for Vue.js
- Storybook for Ember
Updated about 4 years ago