-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
125 lines (116 loc) · 2.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
variables:
POSTGRES_DB: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: super_secret_password__DO_NOT_STEAL
CI_DATABASE: postgres
image: maxjohansen/volkano
stages:
- Code climate
- Unit tests
- End to end tests
- Reporting
- Deploy
rubocop:
stage: Code climate
tags:
- ci-alpine-latest
script:
- rubocop -R backend
jest:
stage: Unit tests
tags:
- ci-alpine-latest
cache:
key: dependencies
policy: push
paths:
- frontend/node_modules
script:
- cd frontend
- yarn install
- yarn ci
artifacts:
paths:
- frontend/coverage/
rspec:
stage: Unit tests
tags:
- ci-alpine-latest
services:
- postgres:alpine
cache:
key: dependencies
policy: push
paths:
- backend/.bundle
- gems
script:
- cd backend
- bundle install --jobs $(nproc) --path=../gems
- bundle exec rspec
artifacts:
paths:
- backend/coverage/
coverage:
stage: Reporting
tags:
- ci-alpine-latest
dependencies:
- rspec
- jest
script:
- ./report_coverage.sh
cypress:
stage: End to end tests
tags:
- ci-alpine-latest
artifacts:
when: on_failure
paths:
- frontend/cypress/screenshots/
- frontend/cypress/videos/
- backend/log/
services:
- postgres:alpine
dependencies: []
variables:
DATABASE_URL: postgres://postgres:super_secret_password__DO_NOT_STEAL@postgres:5432
RAILS_ENV: production
cache:
key: dependencies
policy: pull
paths:
- frontend/node_modules
- backend/.bundle
- gems
script:
- cd backend
- bundle install --jobs $(nproc) --path=../gems
- bundle exec rails db:create db:migrate db:seed
- bundle exec rails s &
- cd ../frontend
- yarn install
- PORT=3000 yarn start &
- yarn cyprecord
staging:
type: Deploy
tags:
- ci-alpine-latest
dependencies: []
script:
- gem install dpl
- dpl --provider=heroku --app=volkano-staging --api-key=$HEROKU_API_KEY
- dpl --provider=heroku --app=volkano-staging-api --api-key=$HEROKU_API_KEY
only:
- development
production:
type: Deploy
tags:
- ci-alpine-latest
dependencies: []
script:
- gem install dpl
- dpl --provider=heroku --app=volkano --api-key=$HEROKU_API_KEY
- dpl --provider=heroku --app=volkano-api --api-key=$HEROKU_API_KEY
only:
- master