Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created November 8, 2017 21:05
Show Gist options
  • Save teeparham/7c3d09189d5b9a48b195b0555a67191d to your computer and use it in GitHub Desktop.
Save teeparham/7c3d09189d5b9a48b195b0555a67191d to your computer and use it in GitHub Desktop.
CircleCI config for rails + postgis
version: 2
jobs:
build:
parallelism: 1
working_directory: ~/yourapp
environment:
DATABASE_URL: postgis://postgres@localhost/yourapp_test
docker:
- image: circleci/ruby:2.4-node-browsers
env:
RAILS_ENV: test
PGHOST: 127.0.0.1
PGUSER: postgres
- image: mdillon/postgis:9.6
env:
POSTGRES_USER: postgres
POSTGRES_DB: yourapp_test
POSTGRES_PASSWORD:
steps:
- checkout
- restore_cache:
key: yourapp-{{ checksum "Gemfile.lock" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: yourapp-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
- run: sudo apt install postgresql-client
- run: bin/rails db:structure:load --trace
- run: bundle exec rake test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment