Skip to content
Snippets Groups Projects
Commit c33755ee authored by David Dorchies's avatar David Dorchies
Browse files

Merge branch '630-ci-change-cache-strategy-for-node-modules' into 'devel'

Resolve "CI: change cache strategy for node modules"

Closes #630

See merge request !230
parents 1a3111e3 7d35dfe4
No related branches found
No related tags found
1 merge request!230Resolve "CI: change cache strategy for node modules"
Pipeline #143633 passed
...@@ -9,7 +9,7 @@ stages: ...@@ -9,7 +9,7 @@ stages:
- releases-version - releases-version
default: default:
tags: [mia2] tags: [docker]
image: geaucassiopee/ci-cd-cross-platform-webapp:v3 image: geaucassiopee/ci-cd-cross-platform-webapp:v3
variables: variables:
...@@ -37,36 +37,25 @@ before_script: ...@@ -37,36 +37,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:
key:
files:
- jalhyd_branch
- package.json
paths:
- node_modules/
- jalhyd/
install: install:
stage: install stage: install
only: artifacts:
- pushes paths:
- tags - node_modules/
- schedules - jalhyd/
- web expire_in: 1 min
script: script:
- JALHYD_BRANCH=`cat jalhyd_branch` - JALHYD_BRANCH=`cat jalhyd_branch`
- echo "CI_COMMIT_REF_NAME - $CI_COMMIT_REF_NAME" - echo "CI_COMMIT_REF_NAME - $CI_COMMIT_REF_NAME"
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then JALHYD_BRANCH="master"; fi - if [ "$CI_COMMIT_REF_NAME" = "master" ]; then JALHYD_BRANCH="master"; fi
- if [ "$CI_COMMIT_REF_NAME" = "devel" ]; then JALHYD_BRANCH="devel"; fi - if [ "$CI_COMMIT_REF_NAME" = "devel" ]; then JALHYD_BRANCH="devel"; fi
- echo "Branche JalHyd - $JALHYD_BRANCH" - echo "Branche JalHyd - $JALHYD_BRANCH"
- rm -rf jalhyd
- git clone https://forgemia.inra.fr/cassiopee/jalhyd.git - git clone https://forgemia.inra.fr/cassiopee/jalhyd.git
- cd jalhyd - cd jalhyd
- git checkout "$JALHYD_BRANCH" || git checkout devel - git checkout "$JALHYD_BRANCH" || git checkout devel
- npm ci --force - npm ci --force
- npm run build - npm run build
- cd .. - cd ..
- rm -rf node_modules
- npm ci --force --unsafe-perm - npm ci --force --unsafe-perm
test: test:
...@@ -81,6 +70,8 @@ test: ...@@ -81,6 +70,8 @@ test:
.build: .build:
stage: build stage: build
dependencies:
- install
artifacts: artifacts:
expire_in: 10 min expire_in: 10 min
paths: paths:
...@@ -157,7 +148,8 @@ releases-nightly: ...@@ -157,7 +148,8 @@ releases-nightly:
except: except:
# exclude master to apply releases-nightly on devel only # exclude master to apply releases-nightly on devel only
- master - master
dependencies: [] dependencies:
- install
script: script:
- ./scripts/release-version.sh nightly $PROD_LOGIN $PROD_HOST $RELEASES_PATH - ./scripts/release-version.sh nightly $PROD_LOGIN $PROD_HOST $RELEASES_PATH
...@@ -166,6 +158,7 @@ releases-version: ...@@ -166,6 +158,7 @@ releases-version:
only: only:
variables: variables:
- $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag - $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag
dependencies: [] dependencies:
- install
script: script:
- ./scripts/release-version.sh $CI_COMMIT_REF_NAME $PROD_LOGIN $PROD_HOST $RELEASES_PATH - ./scripts/release-version.sh $CI_COMMIT_REF_NAME $PROD_LOGIN $PROD_HOST $RELEASES_PATH
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