Skip to content
Snippets Groups Projects
Commit 41a677e0 authored by François Grand's avatar François Grand
Browse files

fix(ci) : use jalhyd branch name to provide cache key through variable

refs #526
parent 4c6a0184
No related branches found
No related tags found
No related merge requests found
Pipeline #139479 canceled
......@@ -34,17 +34,19 @@ before_script:
# disable console prompt for host checking
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
cache:
key:
files:
- jalhyd_branch
- package.json
paths:
- node_modules/
# set cache key
- CACHE_KEY=$(cat jalhyd_branch)
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then CACHE_KEY="master"; fi
- if [ "$CI_COMMIT_REF_NAME" = "devel" ]; then CACHE_KEY="devel"; fi
- echo CACHE_KEY $CACHE_KEY
- export CACHE_KEY
jalhyd:
stage: jalhyd
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- pushes
- tags
......@@ -66,6 +68,10 @@ jalhyd:
install:
stage: install
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- pushes
- tags
......@@ -77,6 +83,10 @@ install:
test:
stage: test
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- tags
- schedules
......@@ -86,6 +96,10 @@ test:
build:
stage: build
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- pushes
- tags
......@@ -100,6 +114,10 @@ build:
clean-stale-branches:
stage: clean-stale-branches
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- pushes
- tags
......@@ -109,6 +127,10 @@ clean-stale-branches:
deploy-dev:
stage: deploy-dev
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- pushes
- tags
......@@ -121,6 +143,10 @@ deploy-dev:
deploy-prod:
stage: deploy-prod
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
variables:
- $CI_COMMIT_REF_NAME == "stable"
......@@ -131,6 +157,10 @@ deploy-prod:
releases-nightly:
stage: releases-nightly
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
- schedules
except:
......@@ -142,6 +172,10 @@ releases-nightly:
releases-version:
stage: releases-version
cache:
key: "$CACHE_KEY"
paths:
- node_modules/
only:
variables:
- $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment