Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: 2
- jobs:
- build:
- working_directory: ~/myemergencycontactnumber-api
- docker:
- - image: circleci/ruby:2.4.1-node
- environment:
- RAILS_ENV: continous_integration
- PGHOST: 127.0.0.1
- PGUSER: rails_test_user
- - image: circleci/postgres:9.6.3-alpine
- environment:
- POSTGRES_USER: rails_test_user
- POSTGRES_PASSWORD: ""
- POSTGRES_DB: continous_integration
- steps:
- - checkout
- - restore_cache:
- keys:
- - myemergencycontactnumber-api-{{ checksum "Gemfile.lock" }}
- - myemergencycontactnumber-api-
- - save_cache:
- key: rails-demo-{{ checksum "Gemfile.lock" }}
- paths:
- - vendor/bundle
- - run:
- name: Setup Bundler and Gems
- command: |
- gem install bundler
- gem update bundler
- gem install brakeman
- gem install rubocop
- gem install rubocop-rspec
- bundle config without development:test
- bundle check --path=vendor/bundle || bundle install --without development test --path=vendor/bundle --jobs 4 --retry 3
- - run:
- name: Setup Postgres
- command: |
- sudo apt-get install postgresql-client
- - run:
- name: Setup Rails Database
- command: |
- RAILS_ENV=continous_integration bundle exec rake db:drop
- RAILS_ENV=continous_integration bundle exec rake db:setup
- - run:
- name: Run Brakeman
- command: |
- RAILS_ENV=continous_integration brakeman -z
- - run:
- name: Run Rubocop
- command: |
- RAILS_ENV=continous_integration bundle exec rubocop --format fuubar --require rubocop-rspec --config .rubocop.yml
- - run:
- name: Run Rspec
- command: |
- RAILS_ENV=continous_integration bundle exec rspec --format RspecJunitFormatter -o /tmp/test-results/rspec.xml
- - store_test_results:
- path: /tmp/test-results
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement