Guest User

Untitled

a guest
Jul 23rd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. version: 2.0
  2. jobs:
  3. build:
  4. working_directory: ~/electrik_backend
  5. docker:
  6. - image: circleci/ruby:2.4.1-node-browsers
  7. - image: postgres:9.6.2-alpine
  8. environment:
  9. POSTGRES_USER: postgres
  10. POSTGRES_DB: postgres_test
  11. steps:
  12. - checkout
  13.  
  14. # Bundle install dependencies
  15. - run:
  16. name: Install dependencies
  17. command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3
  18.  
  19. # Restore bundle cache
  20. - restore_cache:
  21. keys:
  22. - rails-demo-{{ checksum "Gemfile.lock" }}
  23. - rails-demo-
  24.  
  25. # Store bundle cache
  26. - save_cache:
  27. key: rails-demo-{{ checksum "Gemfile.lock" }}
  28. paths:
  29. - vendor/bundle
  30.  
  31. - run:
  32. name: install dockerize
  33. 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
  34. environment:
  35. DOCKERIZE_VERSION: v0.3.0
  36. - run:
  37. name: Wait for db
  38. command: dockerize -wait tcp://localhost:5432 -timeout 1m
  39.  
  40. # Setup the database
  41. - run: bundle exec rake db:create db:migrate
  42. - run: rails db:test:prepare
  43. - run: rspec
  44.  
  45. development:
  46. adapter: postgresql
  47. encoding: unicode
  48. database: electrik_development
  49. host: localhost
  50. pool: 5
  51. username: postgres
  52. password: test123
  53.  
  54. test:
  55. adapter: postgresql
  56. encoding: unicode
  57. database: electrik_test
  58. host: localhost
  59. pool: 5
  60. username: postgres
  61. password: test123
Add Comment
Please, Sign In to add comment