Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. version: 2
  2. jobs:
  3. build:
  4. working_directory: ~/myemergencycontactnumber-api
  5. docker:
  6. - image: circleci/ruby:2.4.1-node
  7. environment:
  8. RAILS_ENV: continous_integration
  9. PGHOST: 127.0.0.1
  10. PGUSER: rails_test_user
  11.  
  12. - image: circleci/postgres:9.6.3-alpine
  13. environment:
  14. POSTGRES_USER: rails_test_user
  15. POSTGRES_PASSWORD: ""
  16. POSTGRES_DB: continous_integration
  17.  
  18. steps:
  19. - checkout
  20.  
  21. - restore_cache:
  22. keys:
  23. - myemergencycontactnumber-api-{{ checksum "Gemfile.lock" }}
  24. - myemergencycontactnumber-api-
  25.  
  26. - save_cache:
  27. key: rails-demo-{{ checksum "Gemfile.lock" }}
  28. paths:
  29. - vendor/bundle
  30.  
  31. - run:
  32. name: Setup Bundler and Gems
  33. command: |
  34. gem install bundler
  35. gem update bundler
  36. gem install brakeman
  37. gem install rubocop
  38. gem install rubocop-rspec
  39. bundle config without development:test
  40. bundle check --path=vendor/bundle || bundle install --without development test --path=vendor/bundle --jobs 4 --retry 3
  41.  
  42. - run:
  43. name: Setup Postgres
  44. command: |
  45. sudo apt-get install postgresql-client
  46.  
  47. - run:
  48. name: Setup Rails Database
  49. command: |
  50. RAILS_ENV=continous_integration bundle exec rake db:drop
  51. RAILS_ENV=continous_integration bundle exec rake db:setup
  52.  
  53. - run:
  54. name: Run Brakeman
  55. command: |
  56. RAILS_ENV=continous_integration brakeman -z
  57.  
  58. - run:
  59. name: Run Rubocop
  60. command: |
  61. RAILS_ENV=continous_integration bundle exec rubocop --format fuubar --require rubocop-rspec --config .rubocop.yml
  62.  
  63. - run:
  64. name: Run Rspec
  65. command: |
  66. RAILS_ENV=continous_integration bundle exec rspec --format RspecJunitFormatter -o /tmp/test-results/rspec.xml
  67.  
  68. - store_test_results:
  69. path: /tmp/test-results
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement