Skip to main content

Continuous Integration - Overview

Preevy is designed to be easily run in CI/CD workflows, such as GH Actions, Circle CI and others. By sharing profiles, Preevy is able to easily deploy to the same VM when new code is pushed to some branch.

The most common use-case for a CI job that runs Preevy is to have a live preview environment for every Pull Request as part of the review process. This allows for more collaborative and inclusive review workflows

Running Preevy in your CI pipeline

Make sure your profile is accessible remotely

The Preevy Profile contains your tunneling key and driver data. The tunneling key determines the URLs generated per environment. The driver data allows you to update existing environments when a PR changes.

Preevy stores the profile on a file, on your local FS or on a remote storage on your cloud provider - currently AWS S3 and Google Cloud Storage are supported. To use the profile across CI jobs, it needs to be stored remotely. To create a new profile, run preevy init. To start using an existing profile stored remotely, run preevy init --from <profile-location>.

Option 1: Create a new Preevy Profile on a remote location

preevy init [profile-name]

When asked where to store the profile, choose AWS S3 or Google Cloud Storage.

Then, choose a URL to store the profile (Preevy will conveniently suggest one for you). For S3, it should look something like s3://preview-8450209857-ci?region=us-east-1

Option 2: If you already have a profile stored locally, migrate it to a remote location:

preevy profile cp --target-storage s3 # to use AWS S3
preevy profile cp --target-storage gs # to use Google Cloud Storage

Once the profile has migrated to a remote location, you can specify the new location URL in the preevy init --from command - see below.

In your CI pipeline, import the profile

Use the following commands in your CI job to import the Preevy Profile and provision an environment for your PR:

preevy init --from "s3://preview-8450209857-ci?region=us-east-1"
preevy up

See the next sections for detailed examples using GitHub Actions.