CircleCI

This chapter shows how to integrate with FeaturePeek when using the CircleCI continuous integration service.

Prerequisite: You should create a FeaturePeek account and configure your peek.yml file before following the steps in this chapter.

Example config file

If you already have your config file set up, simply append the FeaturePeek CI command after your build phase.

If you don't have your config file set up yet, take a look at these examples provided by CircleCI to get started.

Your /.circleci/config.yml file should look something like this:

# /.circleci/config.yml
version: 2.0
jobs:
build:
docker:
- image: circleci/node:lts
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: yarn
- save_cache:
key: v1-dependencies-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: Build static assets
command: yarn build
- run:
name: Ping FeaturePeek
command: bash <(curl -s https://peek.run/ci)

Note: The command in the snippet above is just for static builds — if you are building a Docker image, you'll need to pass in more arguments.

Sample code repo

You can search the FeaturePeek org on GitHub to find sample repos of frontends that integrate FeaturePeek with CircleCI. Be sure to visit the open pull requests to find links to running public FeaturePeek deployments.

Additionally, our static marketing website uses CircleCI to create FeaturePeek deployment previews. It's open source — take a look at the CircleCI config file for a real-world example of how to integrate with FeaturePeek.

Try it out

Try opening a new pull request that contain the changes in this chapter. When your CI finishes successfully, you should see the FeaturePeek bot comment a link on your pull request. If not, consult our Troubleshooting section.