forked from sidestream-tech/unified-auctions-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
336 lines (320 loc) · 10.8 KB
/
.drone.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
kind: template
load: pipeline-builder.star
data:
builds:
# frontend:main and frontend:$MAIN_COMMIT_SHA
- name: publish-frontend-merge-main
repository: ghcr.io/sidestream-tech/unified-auctions-ui/frontend
tags:
- "main"
- "${DRONE_COMMIT_SHA}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: frontend/Dockerfile
path_to_context: ./
build_args:
- key: PRODUCTION_DOMAIN
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/production_domain
- key: RPC_URL
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/rpc_url
- key: CONTACT_EMAIL
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/contact_email
- key: STAGING_BANNER_URL
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/staging_banner_url
- key: HEAPIO_ID
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/heapio_id
- key: FRONTEND_ORIGIN
value_from_secret: auction-ui/main.auction-ui.k8s.sidestream.tech/frontend/frontend_origin
tags_to_cache_from:
- "main"
trigger:
event:
- push
branch:
- main
# frontend no tag, just test production build
- name: build-frontend-to-test-production-build
repository: ghcr.io/sidestream-tech/unified-auctions-ui/frontend
path_to_dockerfile: frontend/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# frontend:pr-$PULL_REQUEST_NUMBER
- name: publish-frontend-on-pr-push
target: development
repository: ghcr.io/sidestream-tech/unified-auctions-ui/frontend
tags:
- "pr-${DRONE_PULL_REQUEST}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: frontend/Dockerfile
path_to_context: ./
build_args:
- key: PRODUCTION_DOMAIN
value: "null.sidestream.tech"
- key: RPC_URL
value: "key-not-provided"
- key: CONTACT_EMAIL
value: "[email protected]"
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# core:pr-$PULL_REQUEST_NUMBER
- name: publish-core-on-pr-push
target: development
repository: ghcr.io/sidestream-tech/unified-auctions-ui/core
tags:
- "pr-${DRONE_PULL_REQUEST}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: core/Dockerfile
path_to_context: ./
build_args:
- key: REMOTE_RPC_URL
value_from_secret: auction-ui/localhost/hardhat/alchemy_url
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# hardhat:pr-$PULL_REQUEST_NUMBER
- name: publish-hardhat-on-pr-push
target: development
repository: ghcr.io/sidestream-tech/unified-auctions-ui/hardhat
build_args:
- key: ALCHEMY_URL
value_from_secret: auction-ui/localhost/hardhat/alchemy_url
tags:
- "pr-${DRONE_PULL_REQUEST}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: hardhat/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# frontend-makerdao:$RELEASE_TAG
- name: publish-frontend-makerdao-on-tag
repository: ghcr.io/sidestream-tech/unified-auctions-ui/frontend-makerdao
tags:
- "${DRONE_TAG}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: frontend/Dockerfile
path_to_context: ./
build_args:
- key: PRODUCTION_DOMAIN
value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/production_domain
- key: RPC_URL
value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/rpc_url
- key: CONTACT_EMAIL
value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/contact_email
- key: HEAPIO_ID
value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/heapio_id
- key: FRONTEND_ORIGIN
value_from_secret: auction-ui/production.auction-ui.k8s.sidestream.tech/frontend/frontend_origin
tags_to_cache_from:
- "main"
trigger:
event:
- tag
# bot:main and bot:$MAIN_COMMIT_SHA
- name: publish-bot-merge-main
repository: ghcr.io/sidestream-tech/unified-auctions-ui/bot
tags:
- "main"
- "${DRONE_COMMIT_SHA}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: bot/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- push
branch:
- main
# bot no tag, just test production build
- name: build-bot-to-test-production-build
repository: ghcr.io/sidestream-tech/unified-auctions-ui/bot
path_to_dockerfile: bot/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# bot:$RELEASE_TAG
- name: publish-bot-on-tag
repository: ghcr.io/sidestream-tech/unified-auctions-ui/bot
tags:
- "${DRONE_TAG}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: bot/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- tag
# bot:pr-$PULL_REQUEST_NUMBER
- name: publish-bot-on-pr-push
target: development
repository: ghcr.io/sidestream-tech/unified-auctions-ui/bot
tags:
- "pr-${DRONE_PULL_REQUEST}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: bot/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
# notification-service:pr-$PULL_REQUEST_NUMBER
- name: publish-notification-service-on-pr-push
target: development
repository: ghcr.io/sidestream-tech/unified-auctions-ui/notification-service
tags:
- "pr-${DRONE_PULL_REQUEST}"
labels:
- key: org.opencontainers.image.source
value: https://github.com/sidestream-tech/unified-auctions-ui
path_to_dockerfile: notification-service/Dockerfile
path_to_context: ./
tags_to_cache_from:
- "main"
trigger:
event:
- pull_request
deployments_to_aws_eks:
- name: deploy-main.auction-ui.k8s.sidestream.tech
depends_on:
- publish-bot-merge-main
- publish-frontend-merge-main
trigger:
event:
- push
branch:
- main
settings:
helm_root_path: kubernetes/helm
aws_target_eks_cluster_name: eks-cluster-sidestream
aws_ssm_path_to_base64_encoded_secrets_yaml: auction-ui/secrets.yaml
value_files:
- values.yaml
- values.override_main.auction-ui.k8s.sidestream.tech.yaml
target_namespace: "auction-ui-main"
release_name: "auction-ui"
values_to_set:
- frontend.deployment.tag=$DRONE_COMMIT_SHA
- bot.deployment.tag=$DRONE_COMMIT_SHA
- name: deploy-unified-auctions.makerdao.com
depends_on:
- publish-bot-on-tag
- publish-frontend-makerdao-on-tag
trigger:
event:
- tag
settings:
helm_root_path: kubernetes/helm
aws_target_eks_cluster_name: eks-cluster-sidestream
aws_ssm_path_to_base64_encoded_secrets_yaml: auction-ui/secrets.yaml
value_files:
- values.yaml
- values.override_unified-auctions.makerdao.com.yaml
target_namespace: "auction-ui-production"
release_name: "auction-ui"
values_to_set:
- frontend.deployment.tag=$DRONE_TAG
- bot.deployment.tag=$DRONE_TAG
in_development_image_pipelines:
- name: core-lint-build
type: kubernetes
depends_on: [publish-frontend-on-pr-push]
image: ghcr.io/sidestream-tech/unified-auctions-ui/frontend:pr-${DRONE_PULL_REQUEST}
workdir: /core
steps_parallel:
- name: lint
command: npm run lint
- name: build
command: npm run build
trigger:
event:
- pull_request
- name: frontend-lint-test
type: kubernetes
depends_on: [publish-frontend-on-pr-push]
image: ghcr.io/sidestream-tech/unified-auctions-ui/frontend:pr-${DRONE_PULL_REQUEST}
workdir: /frontend
steps_parallel:
- name: lint
command: npm run lint
- name: test
command: npm run test
trigger:
event:
- pull_request
- name: bot-lint
type: kubernetes
depends_on: [publish-bot-on-pr-push]
image: ghcr.io/sidestream-tech/unified-auctions-ui/bot:pr-${DRONE_PULL_REQUEST}
workdir: /bot
steps_parallel:
- name: lint
command: npm run lint
trigger:
event:
- pull_request
- name: notification-service-lint
type: kubernetes
depends_on: [publish-notification-service-on-pr-push]
image: ghcr.io/sidestream-tech/unified-auctions-ui/notification-service:pr-${DRONE_PULL_REQUEST}
workdir: /notification-service
steps_parallel:
- name: lint
command: npm run lint
trigger:
event:
- pull_request
pipelines:
- kind: pipeline
type: kubernetes
name: core-integration-test
trigger:
event:
- pull_request
environment:
LOCAL_RPC_URL: "http://hardhat-service:8545"
steps:
- name: core-integration-test
image: ghcr.io/sidestream-tech/unified-auctions-ui/core:pr-${DRONE_PULL_REQUEST}
commands:
- cd core
- npm ci
- npm run test
services:
- name: hardhat-service # named with 'service' to avoid duplication with the default value
image: ghcr.io/sidestream-tech/unified-auctions-ui/hardhat:pr-${DRONE_PULL_REQUEST}
expose: 8545
depends_on:
- publish-core-on-pr-push
- publish-hardhat-on-pr-push