forked from mozilla-releng/balrog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
311 lines (302 loc) · 11.8 KB
/
.taskcluster.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
version: 1
policy:
pullRequests: public
tasks:
$let:
# Github events have this stuff in different places...
repo_url: {
$if: 'tasks_for == "github-push"',
then: '${event.repository.clone_url}',
else: {
$if: 'tasks_for == "github-pull-request"',
then: '${event.pull_request.head.repo.clone_url}',
# Assume release event
else: '${event.repository.clone_url}',
}
}
head_sha: {
$if: 'tasks_for == "github-push"',
then: '${event.after}',
else: {
$if: 'tasks_for == "github-pull-request"',
then: '${event.pull_request.head.sha}',
# Assume release event
else: '${event.release.tag_name}',
}
}
owner_email: {
$if: 'tasks_for == "github-push"',
then: '${event.pusher.email}',
else: {
$if: 'tasks_for == "github-pull-request"',
then: '${event.pull_request.user.login}@users.noreply.github.com',
# Assume release event
else: '${event.sender.login}@users.noreply.github.com',
}
}
docker_tags: {
$if: 'tasks_for == "github-push"',
then: 'latest ${event.after}',
else: {
$if: 'tasks_for == "github-release"',
then: '${event.release.tag_name}',
# Unused
else: ''
}
}
# jsone doesn't support shortcircuiting evaluation, and we need to use
# ${event.release.tag_name} as part of a conditional for release event
# tasks, so we need to create this variable to make sure it always
# has a value instead of using ${event.release.tag_name} directly.
release_tag: {
$if: 'tasks_for == "github-release"',
then: '${event.release.tag_name}',
else: 'null',
}
branch: {
$if: 'tasks_for == "github-push"',
then: '${event.ref}',
else: 'null',
}
in:
$flattenDeep:
- $if: '(tasks_for == "github-pull-request" && event["action"] in ["edited", "opened", "reopened", "synchronize"]) || (tasks_for == "github-push" && branch == "refs/heads/master")'
then:
- taskId: {$eval: as_slugid("backend-tests")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- secrets:get:repo:github.com/mozilla/balrog:coveralls
routes: []
payload:
maxRunTime: 1200
image: "mozillareleases/python-test-runner"
env:
NO_VOLUME_MOUNT: 1
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && bash run-tests.sh backend"
features:
dind: true
taskclusterProxy: true
metadata:
name: Balrog back-end tests
description: Balrog Python tests
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("agent-tests")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
routes: []
payload:
maxRunTime: 1200
image: "mozillareleases/python-test-runner"
env:
NO_VOLUME_MOUNT: 1
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd agent && bash run-tests.sh"
features:
dind: true
metadata:
name: Balrog agent tests
description: Balrog agent tests
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("client-tests")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
routes: []
payload:
maxRunTime: 1200
image: "mozillareleases/python-test-runner"
env:
NO_VOLUME_MOUNT: 1
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd client && bash run-tests.sh"
features:
dind: true
metadata:
name: Balrog client tests
description: Balrog client tests
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("old-ui-tests")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
routes: []
payload:
maxRunTime: 1200
image: "node:0.10"
env:
NO_VOLUME_MOUNT: 1
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd ui && npm install && npm test"
metadata:
name: Balrog frontend tests
description: Balrog frontend tests
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("ui-tests")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
routes: []
payload:
maxRunTime: 1200
image: "node:10"
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd react-ui && yarn install && yarn lint && yarn test"
metadata:
name: Balrog react frontend tests
description: Balrog react frontend tests
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("ui-build")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes: []
routes: []
payload:
maxRunTime: 1200
image: "node:10"
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd react-ui && yarn install && yarn build"
metadata:
name: Balrog react frontend build
description: Balrog react frontend build
owner: ${owner_email}
source: ${repo_url}
- $if: 'tasks_for == "github-release"'
then:
- taskId: {$eval: as_slugid("agent-docker-image")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- secrets:get:repo:github.com/mozilla/balrog:dockerhub
routes: []
payload:
maxRunTime: 3600
image: "taskcluster/image_builder:0.1.3"
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd agent && scripts/push-dockerimage.sh ${docker_tags}"
features:
dind: true
taskclusterProxy: true
metadata:
name: Balrog agent docker build
description: Balrog agent docker build
owner: ${owner_email}
source: ${repo_url}
- taskId: {$eval: as_slugid("backend-docker-image")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- secrets:get:repo:github.com/mozilla/balrog:dockerhub
routes: []
payload:
maxRunTime: 3600
image: "taskcluster/image_builder:0.1.3"
command:
- "/bin/bash"
- "-c"
- "git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && scripts/push-dockerimage.sh Dockerfile ${docker_tags}"
features:
dind: true
taskclusterProxy: true
metadata:
name: Balrog backend docker build
description: Balrog backend docker build
owner: ${owner_email}
source: ${repo_url}
# Deploy the UI to stage whenever we create a versioned release tag
- $if: 'tasks_for == "github-release" && release_tag[0] == "v"'
then:
- taskId: {$eval: as_slugid("stage-ui-deploy")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- secrets:get:repo:github.com/mozilla/balrog:s3-stage-aws-creds
- secrets:get:repo:github.com/mozilla/balrog:s3-stage-app-config
routes: []
payload:
env:
AWS_CREDENTIALS_SECRET: http://taskcluster/secrets/v1/secret/repo:github.com/mozilla/balrog:s3-stage-aws-creds
APP_CONFIG_SECRET: http://taskcluster/secrets/v1/secret/repo:github.com/mozilla/balrog:s3-stage-app-config
WEBSITE_BUCKET: balrog-stage-balrog-static-admin-stage-static-website
maxRunTime: 3600
image: "node:10"
command:
- "/bin/bash"
- "-c"
- "apt-get -q --yes update && apt-get -q --yes install awscli && git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd react-ui && yarn install && bash ./scripts/deploy"
features:
taskclusterProxy: true
metadata:
name: Balrog stage ui deploy
description: Balrog stage ui deploy
owner: ${owner_email}
source: ${repo_url}
# Deploy to production only for a specific tag
- $if: 'tasks_for == "github-release" && release_tag == "production-ui"'
then:
- taskId: {$eval: as_slugid("prod-ui-deploy")}
created: {$fromNow: ''}
deadline: {$fromNow: '2 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
scopes:
- secrets:get:repo:github.com/mozilla/balrog:s3-prod-aws-creds
- secrets:get:repo:github.com/mozilla/balrog:s3-prod-app-config
routes: []
payload:
env:
AWS_CREDENTIALS_SECRET: http://taskcluster/secrets/v1/secret/repo:github.com/mozilla/balrog:s3-prod-aws-creds
APP_CONFIG_SECRET: http://taskcluster/secrets/v1/secret/repo:github.com/mozilla/balrog:s3-prod-app-config
WEBSITE_BUCKET: balrog-prod-balrog-static-admin-prod-static-website
maxRunTime: 3600
image: "node:10"
command:
- "/bin/bash"
- "-c"
- "apt-get -q --yes update && apt-get -q --yes install awscli && git clone ${repo_url} balrog && cd balrog && git checkout ${head_sha} && cd react-ui && yarn install && bash ./scripts/deploy"
features:
taskclusterProxy: true
metadata:
name: Balrog prod ui deploy
description: Balrog prod ui deploy
owner: ${owner_email}
source: ${repo_url}