Skip to content

Instantly share code, notes, and snippets.

@dennmart
Created December 16, 2019 09:42
Show Gist options
  • Save dennmart/4b0c05cd20814ca5fdea2ca8dae4920f to your computer and use it in GitHub Desktop.
Save dennmart/4b0c05cd20814ca5fdea2ca8dae4920f to your computer and use it in GitHub Desktop.
version: 2
jobs:
build:
working_directory: ~/airport_gap
docker:
- image: circleci/ruby:2.6.5-node
environment:
PGHOST: 127.0.0.1
PGUSER: airport_gap
- image: circleci/postgres:12.1-alpine
environment:
POSTGRES_USER: airport_gap
POSTGRES_DB: airport_gap_development
POSTGRES_PASSWORD: ""
steps:
- checkout
- run:
name: Configure Bundler
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
- restore_cache:
name: Restore Cache (Bundler)
keys:
- airport-gap-bundler-{{ checksum "Gemfile.lock" }}
- run:
name: Install dependencies (Bundler)
command: bundle install --path vendor/bundle
- save_cache:
name: Saving Cache (Bundler)
key: airport-gap-bundler-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- restore_cache:
name: Restore Cache (Yarn)
keys:
- airport-gap-yarn-{{ checksum "yarn.lock" }}
- run:
name: Install dependencies (Yarn)
command: yarn install --frozen-lockfile --prefer-offline --cache-folder ~/.cache/yarn
- save_cache:
name: Saving Cache (Yarn)
key: airport-gap-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Database setup
command: bin/rails db:prepare
- run:
name: Seed the database
command: bin/rails db:seed
- run:
name: Download APId binary
command: |
curl -o apid https://cdn.getapid.com/cli/latest/apid-latest-linux-amd64
chmod u+x apid
- run:
name: Start application server
command: bin/rails s -d
- run:
name: Wait for application
command: dockerize -wait http://localhost:3000 -timeout 1m
- run:
name: Run end-to-end tests
command: ./apid check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment