# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
version: 2
jobs:
build:
environment:
BUNDLE_GEMFILE: Gemfile
BUNDLE_WITHOUT: "production:staging:development"
docker:
# specify the version you desire here
- image: circleci/ruby:2.4.3-node-browsers
environment:
RAILS_ENV: test
RACK_ENV: test
PGHOST: 127.0.0.1
PGUSER: ubuntu
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/postgres:alpine
environment:
POSTGRES_USER: ubuntu
POSTGRES_DB: rails-bootstrap_test
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "Gemfile.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: bundle check --path vendor/bundle || bundle install --deployment --jobs=4 --retry=3
- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
- restore_cache:
keys:
- v1-asset-cache-{{ arch }}-{{ .Branch }}
- v1-asset-cache-
- run: bundle exec rake assets:precompile
- save_cache:
key: v1-asset-cache-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- public/assets
- tmp/cache/assets/sprockets
- run: bundle exec rake db:schema:load
- run: bundle exec rake test test:system
Rails.application.configure do
# ...
# For Rails 4 we need to add those settings
config.serve_static_files = true
config.static_cache_control = 'public, max-age=2592000'
config.assets.digest = true
config.assets.debug = false
if ENV['CI']
config.assets.compile = false
config.assets.js_compressor = :uglifier
end
end