summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-01-21 20:20:38 +0100
committerRémy Coutable <remy@rymai.me>2019-02-05 14:04:54 +0100
commit6b39f55d3f0ba0d48e920693c4d5128e26769a1c (patch)
treea55eae5d31118fa44d902a932ea638163356d3ed /.gitlab-ci.yml
parent31fc5965baf9ca23a1da4a0ffc350102fe4c89c6 (diff)
downloadgitlab-ce-6b39f55d3f0ba0d48e920693c4d5128e26769a1c.tar.gz
Add cache to the 'compile-assets' and 'gitlab:assets:compile' jobs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml25
1 files changed, 17 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ee9eaeae723..b93a79de994 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -386,20 +386,25 @@ flaky-examples-check:
- scripts/merge-reports ${NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*_*.json
- scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT
+.assets-compile-cache: &assets-compile-cache
+ cache:
+ key: "assets-compile:vendor_ruby:.yarn-cache:tmp_cache_assets_sprockets:v3"
+ paths:
+ - vendor/ruby/
+ - .yarn-cache/
+ - tmp/cache/assets/sprockets
+
compile-assets:
<<: *dedicated-runner
<<: *except-docs
<<: *use-pg
stage: prepare
- cache:
- <<: *default-cache
script:
- node --version
- - date
- yarn install --frozen-lockfile --cache-folder .yarn-cache
- - date
- free -m
- bundle exec rake gitlab:assets:compile
+ - scripts/clean-old-cached-assets
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
@@ -408,6 +413,7 @@ compile-assets:
paths:
- node_modules
- public/assets
+ <<: *assets-compile-cache
setup-test-env:
<<: *dedicated-runner
@@ -628,7 +634,9 @@ gitlab:setup-mysql:
gitlab:assets:compile:
<<: *dedicated-no-docs-pull-cache-job
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.5.3-git-2.18-chrome-71.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1
- dependencies: []
+ dependencies:
+ - setup-test-env
+ - compile-assets
services:
- docker:stable-dind
variables:
@@ -642,18 +650,19 @@ gitlab:assets:compile:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
script:
- - date
+ - node --version
- yarn install --frozen-lockfile --production --cache-folder .yarn-cache
- - date
- free -m
- bundle exec rake gitlab:assets:compile
- - scripts/build_assets_image
+ - time scripts/build_assets_image
+ - scripts/clean-old-cached-assets
artifacts:
name: webpack-report
expire_in: 31d
paths:
- webpack-report/
- public/assets/
+ <<: *assets-compile-cache
only:
- //@gitlab-org/gitlab-ce
- //@gitlab-org/gitlab-ee