Skip to content
Snippets Groups Projects
Commit 8e4d5114 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 #139471 failed
......@@ -24,6 +24,7 @@ variables:
ANDROID_HOME: "/usr/local/android-sdk" # should already be defined in the Docker image
ANDROID_SDK_ROOT: "/usr/local/android-sdk" # should already be defined in the Docker image
RELEASES_PATH: "$PROD_PATH/cassiopee-releases"
CACHE_KEY: $([$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "devel"] && echo $CI_COMMIT_REF_NAME || cat jalhyd_branch)
before_script:
# load private key from GitLab CI variable to deploy on Aubes server
......@@ -35,11 +36,25 @@ before_script:
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
cache:
paths:
- node_modules/
.protected_branches:
cache:
key: $CI_COMMIT_REF_NAME
only:
- master
- devel
.other_branches:
cache:
key:
file jalhyd_branch
except:
- master
- devel
jalhyd:
extends:
- .protected_branches
- .other_branches
stage: jalhyd
only:
- pushes
......@@ -61,6 +76,9 @@ jalhyd:
- npm run build
install:
extends:
- .protected_branches
- .other_branches
stage: install
only:
- pushes
......@@ -72,6 +90,9 @@ install:
- npm ci --force --unsafe-perm
test:
extends:
- .protected_branches
- .other_branches
stage: test
only:
- tags
......@@ -81,6 +102,9 @@ test:
- npm run e2e
build:
extends:
- .protected_branches
- .other_branches
stage: build
only:
- pushes
......@@ -95,6 +119,9 @@ build:
- npm run build -- --base-href=/cassiopee/$CI_COMMIT_REF_NAME/
clean-stale-branches:
extends:
- .protected_branches
- .other_branches
stage: clean-stale-branches
only:
- pushes
......@@ -104,6 +131,9 @@ clean-stale-branches:
- ./scripts/remove-stale-branches.sh $DEV_LOGIN@$DEV_HOST $DEV_PATH
deploy-dev:
extends:
- .protected_branches
- .other_branches
stage: deploy-dev
only:
- pushes
......@@ -116,6 +146,9 @@ deploy-dev:
- ./scripts/deploy-version.sh $CI_COMMIT_REF_NAME $DEV_LOGIN $DEV_HOST $DEV_PATH
deploy-prod:
extends:
- .protected_branches
- .other_branches
stage: deploy-prod
only:
variables:
......@@ -126,6 +159,9 @@ deploy-prod:
- ./scripts/deploy-version.sh stable $PROD_LOGIN $PROD_HOST $PROD_PATH $PROD_PASS
releases-nightly:
extends:
- .protected_branches
- .other_branches
stage: releases-nightly
only:
- schedules
......@@ -137,6 +173,9 @@ releases-nightly:
- ./scripts/release-version.sh nightly $PROD_LOGIN $PROD_HOST $RELEASES_PATH
releases-version:
extends:
- .protected_branches
- .other_branches
stage: releases-version
only:
variables:
......
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