Skip to content

Commit

Permalink
refs #3 masterからブランチ切り直し
Browse files Browse the repository at this point in the history
  • Loading branch information
hamapu committed Sep 30, 2019
1 parent f089be2 commit 520b5de
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions app/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 2 # use CircleCI 2.0
jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
parallelism: 3 # run three instances of this job in parallel
docker: # run the steps with Docker
- image: circleci/2.6.4-stretch-node-browsers-legacy # ...with this image as the primary container; this is where all `steps` will run
environment: # environment variables for primary container
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
PGHOST: 127.0.0.1
PGUSER: circleci-demo-ruby
RAILS_ENV: test
- image: circleci/mysql:latest # database image
environment: # environment variables for database
POSTGRES_USER: circleci-demo-ruby
POSTGRES_DB: rails_blog
POSTGRES_PASSWORD: ""
steps: # a collection of executable commands
- checkout # special step to check out source code to working directory

# Which version of bundler?
- run:
name: Which bundler?
command: bundle -v

# Restore bundle cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
- restore_cache:
keys:
- rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
- rails-demo-bundle-v2-

- run: # Install Ruby dependencies
name: Bundle Install
command: bundle check --path vendor/bundle || bundle install --deployment

# Store bundle cache for Ruby dependencies
- save_cache:
key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle

- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m

- run:
name: Database setup
command: bin/rails db:create || bin/rails db:migrate RAILS_ENV=deployment || bin/rails db:seed RAILS_ENV=deployment

- run:
name: Run rspec in parallel
command: bundle exec rspec

# Save test results for timing analysis
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: test_results
# See https://circleci.com/docs/2.0/deployment-integrations/ for example deploy configs

0 comments on commit 520b5de

Please sign in to comment.