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

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

refs #526
parent dcd89b7f
No related branches found
No related tags found
No related merge requests found
Pipeline #139474 canceled
......@@ -34,13 +34,25 @@ before_script:
# disable console prompt for host checking
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# set cache key
- JALHYD_BRANCH=`cat jalhyd_branch`
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then JALHYD_BRANCH="master"; fi
- if [ "$CI_COMMIT_REF_NAME" = "devel" ]; then JALHYD_BRANCH="devel"; fi
- echo $JALHYD_BRANCH > cache-key
cache:
paths:
- node_modules/
.set-cache:
cache:
key:
files:
- cache-key
paths:
- node_modules/
jalhyd:
stage: jalhyd
extends:
- .set-cache
only:
- pushes
- tags
......@@ -62,6 +74,8 @@ jalhyd:
install:
stage: install
extends:
- .set-cache
only:
- pushes
- tags
......@@ -73,6 +87,8 @@ install:
test:
stage: test
extends:
- .set-cache
only:
- tags
- schedules
......@@ -82,6 +98,8 @@ test:
build:
stage: build
extends:
- .set-cache
only:
- pushes
- tags
......@@ -96,6 +114,8 @@ build:
clean-stale-branches:
stage: clean-stale-branches
extends:
- .set-cache
only:
- pushes
- tags
......@@ -105,6 +125,8 @@ clean-stale-branches:
deploy-dev:
stage: deploy-dev
extends:
- .set-cache
only:
- pushes
- tags
......@@ -117,6 +139,8 @@ deploy-dev:
deploy-prod:
stage: deploy-prod
extends:
- .set-cache
only:
variables:
- $CI_COMMIT_REF_NAME == "stable"
......@@ -127,6 +151,8 @@ deploy-prod:
releases-nightly:
stage: releases-nightly
extends:
- .set-cache
only:
- schedules
except:
......@@ -138,6 +164,8 @@ releases-nightly:
releases-version:
stage: releases-version
extends:
- .set-cache
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