From 7f1216e1fd5f01203fa79c6a2fb0d3728c8fb9b0 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 10 Jan 2018 20:53:42 -0700 Subject: [PATCH] rerun yarn in each job in the CI pipeline - only rely on .yarn-cache, not node_modules --- .gitlab-ci.yml | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 87076f4..f2fa9f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,26 +7,27 @@ yarn: stage: setup cache: paths: - - node_modules/ - .yarn-cache/ script: - - yarn --cache-folder=.yarn-cache + - &run_yarn + yarn --cache-folder=.yarn-cache --no-progress --pure-lockfile lint: stage: verify - cache: + cache: &pull_cache policy: pull paths: - - node_modules/ - script: node_modules/.bin/gulp lint + - .yarn-cache/ + script: + - *run_yarn + - node_modules/.bin/gulp lint bundle-stable: stage: deploy only: - master@antora/antora-ui-default - cache: - policy: pull - paths: - - node_modules/ - script: node_modules/.bin/gulp pack + cache: *pull_cache + script: + - *run_yarn + - node_modules/.bin/gulp pack artifacts: paths: - build/ui-bundle.zip @@ -34,25 +35,21 @@ bundle-dev: stage: deploy except: - master - cache: - policy: pull - paths: - - node_modules/ - script: node_modules/.bin/gulp pack + cache: *pull_cache + script: + - *run_yarn + - node_modules/.bin/gulp pack artifacts: - # automatically expire unless marked "keep" from job page - expire_in: 1 day + expire_in: 1 day # unless marked as keep from job page paths: - build/ui-bundle.zip pages: stage: deploy only: - master@antora/antora-ui-default - cache: - policy: pull - paths: - - node_modules/ + cache: *pull_cache script: + - *run_yarn - node_modules/.bin/gulp build:preview # FIXME figure out a way to avoid copying these files to preview site - rm -rf public/_/{helpers,layouts,partials} -- 2.11.0