|
3 | 3 | # Only use spaces to indent your .yml configuration.
|
4 | 4 | # -----
|
5 | 5 | # You can specify a custom docker image from Docker Hub as your build environment.
|
6 |
| -image: ruby:2.5.3 |
7 |
| - |
8 |
| -pipelines: |
9 |
| - branches: |
10 |
| - develop: |
11 |
| - - step: |
12 |
| - name: Run tests |
13 |
| - caches: |
14 |
| - - bundler |
15 |
| - script: |
16 |
| - - export DATABASE_URL=postgresql://test_user:test_user_password@localhost/ci_test |
17 |
| - - cp config/database.ci.yml config/database.yml |
18 |
| - - bundle install --path vendor/bundle |
19 |
| - - rake db:setup |
20 |
| - - rake db:test:prepare |
21 |
| - - bundle exec rspec spec |
22 |
| - services: |
23 |
| - - postgres |
24 |
| - - step: |
25 |
| - name: Deploy to Staging |
26 |
| - deployment: staging |
27 |
| - script: |
28 |
| - - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git develop:master |
29 |
| - tags: |
30 |
| - release-*: |
31 |
| - - step: |
32 |
| - name: Run tests |
33 |
| - caches: |
34 |
| - - bundler |
35 |
| - script: |
36 |
| - - export DATABASE_URL=postgresql://test_user:test_user_password@localhost/ci_test |
37 |
| - - cp config/database.ci.yml config/database.yml |
38 |
| - - bundle install --path vendor/bundle |
39 |
| - - rake db:setup |
40 |
| - - rake db:test:prepare |
41 |
| - - bundle exec rspec spec |
42 |
| - services: |
43 |
| - - postgres |
44 |
| - - step: |
45 |
| - name: Deploy to Production |
46 |
| - deployment: production |
47 |
| - script: |
48 |
| - - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git master |
| 6 | +image: ruby:2.6.5 |
49 | 7 |
|
50 | 8 | definitions:
|
51 |
| - caches: |
52 |
| - bundler: vendor/bundle |
53 |
| - services: |
54 |
| - postgres: |
55 |
| - image: postgres |
56 |
| - environment: |
57 |
| - POSTGRES_DB: ci_test |
58 |
| - POSTGRES_USER: test_user |
59 |
| - POSTGRES_PASSWORD: test_user_password |
| 9 | + steps: |
| 10 | + - step: &run-audit |
| 11 | + name: Check Vulnerabilities |
| 12 | + script: |
| 13 | + - gem install bundler-audit |
| 14 | + - bundle audit --update |
| 15 | + - step: &run-tests |
| 16 | + name: Run tests |
| 17 | + caches: |
| 18 | + - bundler |
| 19 | + script: |
| 20 | + - export DATABASE_URL=postgresql://test_user:test_user_password@localhost/ci_test |
| 21 | + - cp config/database.ci.yml config/database.yml |
| 22 | + - bundle install --path vendor/bundle |
| 23 | + - bundle exec rake db:setup |
| 24 | + - bundle exec rake db:test:prepare |
| 25 | + - bundle exec rspec spec |
| 26 | + services: |
| 27 | + - postgres |
| 28 | + caches: |
| 29 | + bundler: vendor/bundle |
| 30 | + services: |
| 31 | + postgres: |
| 32 | + image: postgres |
| 33 | + environment: |
| 34 | + POSTGRES_DB: ci_test |
| 35 | + POSTGRES_USER: test_user |
| 36 | + POSTGRES_PASSWORD: test_user_password |
| 37 | + |
| 38 | +pipelines: |
| 39 | + pull-requests: |
| 40 | + "**": |
| 41 | + - step: *run-tests |
| 42 | + branches: |
| 43 | + develop: |
| 44 | + - step: *run-tests |
| 45 | + - step: |
| 46 | + name: Deploy to Staging |
| 47 | + deployment: staging |
| 48 | + script: |
| 49 | + - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git develop:master |
| 50 | + master: |
| 51 | + - step: *run-tests |
| 52 | + - step: |
| 53 | + name: Deploy to Production |
| 54 | + deployment: production |
| 55 | + script: |
| 56 | + - git push https://heroku:[email protected]/$HEROKU_APP_NAME.git master |
0 commit comments