1
- .yarn-install : &yarn-install
2
- - source scripts/utils.sh
3
- - run_timed_command "retry yarn install --frozen-lockfile"
1
+ .yarn-install :
2
+ script :
3
+ - source scripts/utils.sh
4
+ - run_timed_command "retry yarn install --frozen-lockfile"
4
5
5
- .storybook-yarn-install : &storybook-yarn-install
6
- - source scripts/utils.sh
7
- - run_timed_command "retry yarn run storybook:install --frozen-lockfile"
6
+ .storybook-yarn-install :
7
+ script :
8
+ - source scripts/utils.sh
9
+ - run_timed_command "retry yarn run storybook:install --frozen-lockfile"
8
10
9
11
.compile-assets-base :
10
12
extends :
21
23
WEBPACK_COMPILE_LOG_PATH : " tmp/webpack-output.log"
22
24
stage : prepare
23
25
script :
24
- - *yarn-install
25
- - run_timed_command "bin/rake gitlab:assets:compile"
26
+ - !reference [.yarn-install, script]
27
+ - |
28
+ # The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable
29
+ if [[ "${CACHE_ASSETS_AS_PACKAGE}" == "true" ]]; then
30
+ export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum | tee assets-hash.txt)
31
+ source scripts/gitlab_component_helpers.sh
32
+ run_timed_command "download_and_extract_gitlab_assets" || true
33
+ run_timed_command "bin/rake gitlab:assets:compile_with_new_strategy"
34
+ else
35
+ run_timed_command "bin/rake gitlab:assets:compile"
36
+ fi
26
37
- run_timed_command "scripts/clean-old-cached-assets"
27
38
28
39
compile-production-assets :
@@ -42,8 +53,6 @@ compile-production-assets:
42
53
- public/assets/
43
54
- " ${WEBPACK_COMPILE_LOG_PATH}"
44
55
when : always
45
- before_script :
46
- - !reference [.default-before_script, before_script]
47
56
after_script :
48
57
- rm -f /etc/apt/sources.list.d/google*.list # We don't need to update Chrome here
49
58
@@ -88,7 +97,7 @@ update-yarn-cache:
88
97
- .shared:rules:update-cache
89
98
stage : prepare
90
99
script :
91
- - * yarn-install
100
+ - !reference [. yarn-install, script]
92
101
93
102
update-storybook-yarn-cache :
94
103
extends :
@@ -97,7 +106,7 @@ update-storybook-yarn-cache:
97
106
- .shared:rules:update-cache
98
107
stage : prepare
99
108
script :
100
- - * storybook-yarn-install
109
+ - !reference [. storybook-yarn-install, script]
101
110
102
111
.frontend-fixtures-base :
103
112
extends :
@@ -180,7 +189,7 @@ graphql-schema-dump as-if-foss:
180
189
SETUP_DB : " false"
181
190
before_script :
182
191
- !reference [.default-before_script, before_script]
183
- - * yarn-install
192
+ - !reference [. yarn-install, script]
184
193
stage : test
185
194
186
195
.jest-base :
@@ -256,7 +265,7 @@ coverage-frontend:
256
265
optional : true
257
266
stage : post-test
258
267
before_script :
259
- - * yarn-install
268
+ - !reference [. yarn-install, script]
260
269
script :
261
270
- run_timed_command "yarn node scripts/frontend/merge_coverage_frontend.js"
262
271
# Removing the individual coverage results, as we just merged them.
@@ -282,7 +291,7 @@ coverage-frontend:
282
291
stage : test
283
292
dependencies : []
284
293
script :
285
- - * yarn-install
294
+ - !reference [. yarn-install, script]
286
295
- run_timed_command "retry yarn run webpack-prod"
287
296
288
297
qa-frontend-node:14 :
@@ -310,7 +319,7 @@ webpack-dev-server:
310
319
WEBPACK_MEMORY_TEST : " true"
311
320
WEBPACK_VENDOR_DLL : " true"
312
321
script :
313
- - * yarn-install
322
+ - !reference [. yarn-install, script]
314
323
- run_timed_command "retry yarn webpack-vendor"
315
324
- run_timed_command "node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js"
316
325
artifacts :
@@ -328,7 +337,7 @@ bundle-size-review:
328
337
stage : test
329
338
needs : []
330
339
script :
331
- - * yarn-install
340
+ - !reference [. yarn-install, script]
332
341
- scripts/bundle_size_review
333
342
artifacts :
334
343
when : always
@@ -366,7 +375,7 @@ startup-css-check as-if-foss:
366
375
- .frontend-test-base
367
376
- .storybook-yarn-cache
368
377
script :
369
- - * storybook-yarn-install
378
+ - !reference [. storybook-yarn-install, script]
370
379
- yarn run storybook:build
371
380
needs : ["graphql-schema-dump"]
372
381
0 commit comments