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