Commit f59467a0 authored by Rémy Coutable's avatar Rémy Coutable

Cache Webpack assets in frontend assets compilation jobs

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent e6bae0bf
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
cache: cache:
paths: paths:
- vendor/ruby/ - vendor/ruby/
- public/assets/webpack/
- .yarn-cache/ - .yarn-cache/
- tmp/cache/assets/sprockets - tmp/cache/assets/sprockets
- tmp/cache/babel-loader - tmp/cache/babel-loader
...@@ -28,13 +29,14 @@ ...@@ -28,13 +29,14 @@
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
cache: cache:
key: "assets-compile:production:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:tmp_cache_webpack:v9" key: "assets-compile:production:v1"
artifacts: artifacts:
name: webpack-report name: webpack-report
expire_in: 31d expire_in: 31d
paths: paths:
- webpack-report/ - webpack-report/
- public/assets/ - public/assets/application-*.css
- public/assets/application-*.css.gz
script: script:
- node --version - node --version
- retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline - retry yarn install --frozen-lockfile --production --cache-folder .yarn-cache --prefer-offline
...@@ -79,7 +81,7 @@ gitlab:assets:compile pull-cache: ...@@ -79,7 +81,7 @@ gitlab:assets:compile pull-cache:
NODE_OPTIONS: --max_old_space_size=3584 NODE_OPTIONS: --max_old_space_size=3584
WEBPACK_VENDOR_DLL: "true" WEBPACK_VENDOR_DLL: "true"
cache: cache:
key: "assets-compile:v9" key: "assets-compile:test:v1"
artifacts: artifacts:
expire_in: 7d expire_in: 7d
paths: paths:
...@@ -100,7 +102,7 @@ compile-assets pull-push-cache as-if-foss: ...@@ -100,7 +102,7 @@ compile-assets pull-push-cache as-if-foss:
- .as-if-foss - .as-if-foss
cache: cache:
policy: pull-push policy: pull-push
key: "assets-compile:v9:foss" key: "assets-compile:test:as-if-foss:v1"
compile-assets pull-cache: compile-assets pull-cache:
extends: extends:
...@@ -116,7 +118,7 @@ compile-assets pull-cache as-if-foss: ...@@ -116,7 +118,7 @@ compile-assets pull-cache as-if-foss:
- .as-if-foss - .as-if-foss
cache: cache:
policy: pull policy: pull
key: "assets-compile:v9:foss" key: "assets-compile:test:as-if-foss:v1"
.frontend-fixtures-base: .frontend-fixtures-base:
extends: extends:
......
...@@ -55,5 +55,9 @@ package-and-qa: ...@@ -55,5 +55,9 @@ package-and-qa:
extends: extends:
- .package-and-qa-base - .package-and-qa-base
- .qa:rules:package-and-qa - .qa:rules:package-and-qa
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"] needs:
- job: build-qa-image
artifacts: false
- job: gitlab:assets:compile pull-cache
artifacts: false
allow_failure: true allow_failure: true
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment