Running the CI Command

Pinging FeaturePeek is single-step command in your Continuous Integration pipeline. The command downloads and executes a bash script that is hosted on FeaturePeek's servers, so you should be able to ping FeaturePeek no matter which Continuous Integration service you use.

The syntax of the command varies based on whether you are building static assets or a Docker container.

Important: Ping FeaturePeek in CI after your frontend builds.

Static builds

For projects that build static assets, simply run the command after your build phase in CI with no extra arguments:

bash <(curl -s https://peek.run/ci)

The bash script will read the path present in your peek.yml file to find the assets to send over to FeaturePeek. Other information like branch name and pull request build number are present in your CI's environment variables, so you don't need to pass them in manually.

-a: app (optional)

This is the name of an app definition specified in your peek.yml file. It should correspond to the app you just built in CI (so if you just built a Storybook build, you should use the key in your peek.yml file that points to the Storybook output directory in its path).

If your peek.yml file only has one app definition, you may omit this flag.

Dockerized builds

For projects that build with Docker, you'll want to include an extra flag that gives FeaturePeek more context of the location of your built image.

bash <(curl -s https://peek.run/ci) \
-e environment_variable_key=environment_variable_value \
-p docker.io/my-account/my-repo:latest

-a: app (optional)

This is the name of an app definition specified in your peek.yml file. It should correspond to the app you just built in CI (so if you just built a Storybook build, you should use the key in your peek.yml file that points to the Storybook output directory in its path).

If your peek.yml file only has one app definition, you may omit this flag.

-e: environment variable (optional)

If your frontend requires environment variables whose values are dynamically generated at build-time, you can pass in the key/value pairs as arguments with the -e flag. However, if your environment variables between pull requests are constant, it's recommended that you add them to your project settings in your FeaturePeek dashboard instead.

Key/value pairs are separated by the = character. You can repeat the -e flag multiple times to add multiple key/value pairs.

Note: = (equals) and | (pipe) characters are not allowed as env var values.

-p: pull

This is the full path to the docker image you push to your container registry. It contains your registry's domain, image name, and image tag. It should be the same value that you use for docker build and docker push commands.

Below are some examples from various container registries.

Container registrySample value
Amazon ECR$AWS_ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$PROJECT:$TAG
Azure Container Registry$ACR_REGISTRY_ID .azurecr.io/$REPO:$TAG
Docker Hubdocker.io/$USERNAME/$REPO:$TAG
GitHub Packagesdocker.pkg.github.com/$ORG/$REPO/$IMAGE:$TAG
Google Container Registrygcr.io/$GOOGLE_PROJECT_ID/$IMAGE:$TAG

Note: You'll need to ensure that you have certain environment variables set in your CI service so that FeaturePeek has the credentials to pull your images from your registry. Find your container registry in the left sidebar to learn which environment variables are required.

When to run the CI command

Ping FeaturePeek after your app builds, but before any unit or integration tests occur. For the fastest possible spin up times, you'll want to remove any extraneous steps that occur before your build phase. If your CI system supports it, put tests in a parallel job so that your build phase and test phase occur in parallel. That way, your FeaturePeek deployment will be ready as quickly as possible.