Skip to main content
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

Integrate App percy with Google Cloud Build

Integrate App percy with Google Cloud Build, a fully managed CI-CD platform on Google Cloud

Follow these steps to integrate App percy with Google Cloud Build:

Configuring Google Cloud Build environment variables

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

Store PERCY_TOKEN in Google Secret Manager and reference it in your cloudbuild.yaml via availableSecrets and secretEnv. This keeps the token out of your build logs and source control.

Alternatively, you can export the variable as part of your build step:

bash
Copy icon Copy

Commit, branch, and pull request information

App percy auto-detects Google Cloud Build runs via the BUILD_ID and PROJECT_ID environment variables and reads the following native Cloud Build substitutions:

  • COMMIT_SHA — commit SHA
  • BRANCH_NAME — branch name (when triggered by a branch push)
  • _PR_NUMBER — pull request number (when triggered by a pull request)

If your trigger does not populate these substitutions, configure your environment to include PERCY_COMMIT, PERCY_BRANCH, and PERCY_PULL_REQUEST. See the environment variables docs page for more details.

Run your tests

With your environment configured, run your App percy snapshots via your test suite or another mechanism. Your App percy build will be created with the correct meta-data.

bash
Copy icon Copy

Parallelized build processes

If you parallelize your build across multiple steps or build configurations, PERCY_PARALLEL_TOTAL and PERCY_PARALLEL_NONCE need to be configured. App percy automatically uses Cloud Build’s BUILD_ID as the parallel build nonce. Set PERCY_PARALLEL_TOTAL to the total number of parallel builds.

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.

Reference Topic

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 Check Circle