-
Notifications
You must be signed in to change notification settings - Fork 44
/
a.yaml
403 lines (399 loc) · 12.5 KB
/
a.yaml
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
service: lego2
title: frontend/packages/lego-components
shared:
package-env: &package-env
- key: node_js_version
value: 12.18.4
- key: NVM_DIR
value: /opt/nvm
- key: CMD_LINE_PROLOG
value: |
set -exu -o pipefail
cd ..
export TRENDBOX_JOB_ROOT="$PWD"
export TRENDBOX_SYNCHROPHAZOTRON="$SANDBOX_SYNCHROPHAZOTRON_PATH"
export YANDEX_INT_RESOURCES_PATH="$PWD/yandex-int"
mkdir -p "$YANDEX_INT_RESOURCES_PATH"
. $NVM_DIR/nvm.sh
nvm use $node_js_version
echo 'env variables:'
node -p 'Object.entries(process.env).map(([k,v])=>k+"="+(/(pass|secret|ssh|token|auth|access_key)/i.test(k)?"("+v.length+" bytes)":JSON.stringify(v))).join(`\n`)'
cd "$ARCADIA_PATH/${context.config_info.dir}"
mkdir __reports
- key: CI
value: "true"
- key: DEBUG
value: serp:*,-serp:lru-cache,si:archon:*,si:why-is-archon-running,si:ci:arc,si:ci:arc-checkout,si:ci:shelljs,hermione*,testpalm*,palmsync:converter:*
- key: NODE_EXTRA_CA_CERTS
value: /usr/share/yandex-internal-root-ca/YandexInternalRootCA.crt
- key: ARCHON_KOTIK_CACHE_PUBLIC_URL
value: "false"
- key: checkout_config
value: |-
{
"type": "arc",
"path": "frontend",
"isReviewRequest": "true",
"head": {
"commit": "${not_null(context.launch_pull_request_info.vcs_info.feature_revision_hash, '')}",
"branch": "${not_null(context.launch_pull_request_info.vcs_info.feature_branch, '')}"
},
"base": {
"commit": "${not_null(context.launch_pull_request_info.vcs_info.upstream_revision_hash, '')}",
"branch": "${not_null(context.launch_pull_request_info.vcs_info.upstream_branch, '')}"
}
}
- key: TRENDBOX_CI
value: "true"
- key: TRENDBOX_PULL_REQUEST_NUMBER
value: ${to_string(not_null(context.launch_pull_request_info.pull_request.id, ''))}
- key: ISSUE_KEYS
value: ${not_null(context.launch_pull_request_info.issues[].id, context.target_commit.issues[], `[]`) | join(',', @)}
- key: trunk_checkout_config
value: |-
{
"type": "arc",
"path": "frontend",
"isReviewRequest": "false",
"commit": "${not_null(context.target_revision.hash, '')}",
"branch": "${not_null(context.branch, '')}"
}
package-secrets: &package-secrets
- key: FRONTEND_S3_ACCESS_KEY_ID
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: FRONTEND_S3_ACCESS_KEY_ID
- key: FRONTEND_S3_SECRET_ACCESS_KEY
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: FRONTEND_S3_SECRET_ACCESS_KEY
- key: SANDBOX_OAUTH_TOKEN
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: SANDBOX_OAUTH_TOKEN
- key: YAPPY_TOKEN
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: YAPPY_TOKEN
- key: SOLOMON_OAUTH_TOKEN
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: SOLOMON_OAUTH_TOKEN
- key: HORIZON_TOKEN
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: HORIZON_TOKEN
- key: TESTCOP_AUTH_TOKEN
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: TESTCOP_AUTH_TOKEN
- key: LEGO_S3_ACCESS_KEY_ID
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: LEGO_S3_ACCESS_KEY_ID
- key: LEGO_S3_SECRET_ACCESS_KEY
secret_spec:
uuid: sec-01gcywcxy0t31gbygs8pwkrpcc
key: LEGO_S3_SECRET_ACCESS_KEY
common-run-command-config: &common-run-command-config
fixed_sandbox_resources:
- key: node_modules
resource_id: ${tasks.install.node_modules.id}
interpreter_config:
path: /bin/bash
arg: -c
arc_mount_config:
enabled: true
arc_token:
uuid: sec-01febc15vh93tmg8b8hn1ny0ts
key: ARC_TOKEN
environment_variables: *package-env
secret_environment_variables: *package-secrets
direct_output_links: true
logs_config:
redirect_stderr_to_stdout: true
ci:
secret: sec-01febc15vh93tmg8b8hn1ny0ts
permissions:
start-flow:
- service: lego2
- service: frontend
scope: administration
runtime:
sandbox:
owner: FRONTEND
actions:
alt-tier-1-build:
flow: build
triggers:
- on: pr
cleanup:
conditions:
- reasons:
- pr-merged
- pr-discarded
interrupt: true
cleanup: true
- reasons:
- new-diff-set
- finish
interrupt: true
cleanup: false
requirements:
sandbox:
client_tags: LINUX
container_resource: 4835023819
dns: dns64
runtime:
sandbox:
owner: FRONTEND
alt-tier-1-build-optional:
flow: build-optional
triggers:
- on: pr
required: false
cleanup:
conditions:
- reasons:
- pr-merged
- pr-discarded
interrupt: true
cleanup: true
- reasons:
- new-diff-set
- finish
interrupt: true
cleanup: false
requirements:
sandbox:
client_tags: LINUX
container_resource: 4835023819
dns: dns64
runtime:
sandbox:
owner: FRONTEND
alt-tier-1-build-trunk:
flow: build-trunk
triggers:
- on: commit
into:
- trunk
requirements:
sandbox:
client_tags: LINUX
container_resource: 4835023819
dns: dns64
runtime:
sandbox:
owner: FRONTEND
flows:
build:
jobs:
install:
task: common/nodejs/npm/install
eslint:
title: Eslint
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
npm run lint &>> $RESULT_RESOURCES_PATH/command.log
result_resources:
- path: command.log
description: lint log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
needs:
- install
update-pr-description:
title: Update PR description
task: projects/prosperity/pr_description_v2
input:
job_input:
config_path: .config/pr-description-config-standalone.json
section:
- frontend-packages-lego-components
secret_environment_variables:
ARCANUM_API_OAUTH_TOKEN: sec-01gcywcxy0t31gbygs8pwkrpcc#ARCANUM_API_OAUTH_TOKEN
STARTREK_TOKEN: sec-01gcywcxy0t31gbygs8pwkrpcc#STARTREK_TOKEN
needs:
- install
stylelint:
title: Stylelint
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
npm run ci:stylelint &>> $RESULT_RESOURCES_PATH/command.log
result_resources:
- path: command.log
description: ci:stylelint log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
needs:
- install
unit:
title: Unit
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
export MOCHA_OPTS="--reporter=spec --reporter-options output=__reports/report-unit.txt"
set +e
npm run ci:unit &>> $RESULT_RESOURCES_PATH/command.log
export EXIT_CODE=$?
set -e
mv __reports/report-unit $RESULT_RESOURCES_PATH || true
exit "$EXIT_CODE"
result_resources:
- path: command.log
description: ci:unit log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
- path: report-unit
description: Unit report
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_path: index.html
ci_badge_module: NPM_RUN_REPORT
needs:
- install
build-optional:
jobs:
install:
task: common/nodejs/npm/install
deploy:
title: Deploy
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
npm run ci:deploy &>> $RESULT_RESOURCES_PATH/command.log
result_resources:
- path: command.log
description: ci:deploy log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
needs:
- install
cleanup-jobs:
install-cleanup:
task: common/nodejs/npm/install
enable-skipped-tests:
title: Enable skipped tests
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
npm run ci:enable-skipped-tests &>> $RESULT_RESOURCES_PATH/command.log
result_resources:
- path: command.log
description: ci:enable-skipped-tests log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
fixed_sandbox_resources:
- key: node_modules
resource_id: ${tasks.install-cleanup.node_modules.id}
needs:
- install-cleanup
build-trunk:
jobs:
install:
task: common/nodejs/npm/install
deploy-trunk:
title: "Deploy: trunk"
task: common/misc/run_command
input:
config:
<<: *common-run-command-config
cmd_line: |
eval "$CMD_LINE_PROLOG"
tar -zxf {node_modules}
export checkout_config="$trunk_checkout_config"
npm run ci:deploy:master &>> $RESULT_RESOURCES_PATH/command.log
result_resources:
- path: command.log
description: ci:deploy:master log
type: OTHER_RESOURCE
compression_type: none
optional: true
ci_badge: true
ci_badge_module: LOG
needs:
- install
publish-package:
jobs:
version:
task: common/nodejs/npm/version
stage: publish
input:
config:
new_version: ${flow-vars.level}
publish:
task: common/nodejs/npm/publish
input:
config:
npm:
token: sec-01gcywcxy0t31gbygs8pwkrpcc#ROBOT_FRONTEND_NPM_AUTH_TOKEN
needs:
- version
releases:
publish-package:
title: Publish @yandex-lego/components
flow: publish-package
flow-vars-ui:
schema:
type: object
required:
- level
properties:
level:
title: Increment level
type: string
enum:
- patch
- minor
- major
default: patch
stages:
- id: publish
title: Publish
arcanum:
auto_merge:
enabled: false
requirements:
- system: CI
type: "frontend/packages/lego-components: build"
disabling_policy: need_reason