Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: 2.0
- jobs:
- build:
- working_directory: ~/electrik_backend
- docker:
- - image: circleci/ruby:2.4.1-node-browsers
- - image: postgres:9.6.2-alpine
- environment:
- POSTGRES_USER: postgres
- POSTGRES_DB: postgres_test
- steps:
- - checkout
- # Bundle install dependencies
- - run:
- name: Install dependencies
- command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3
- # Restore bundle cache
- - restore_cache:
- keys:
- - rails-demo-{{ checksum "Gemfile.lock" }}
- - rails-demo-
- # Store bundle cache
- - save_cache:
- key: rails-demo-{{ checksum "Gemfile.lock" }}
- paths:
- - vendor/bundle
- - run:
- name: install dockerize
- command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
- environment:
- DOCKERIZE_VERSION: v0.3.0
- - run:
- name: Wait for db
- command: dockerize -wait tcp://localhost:5432 -timeout 1m
- # Setup the database
- - run: bundle exec rake db:create db:migrate
- - run: rails db:test:prepare
- - run: rspec
- development:
- adapter: postgresql
- encoding: unicode
- database: electrik_development
- host: localhost
- pool: 5
- username: postgres
- password: test123
- test:
- adapter: postgresql
- encoding: unicode
- database: electrik_test
- host: localhost
- pool: 5
- username: postgres
- password: test123
Add Comment
Please, Sign In to add comment