From 215d4e12c214a37f19f4f3f364ca0ba409fc1b18 Mon Sep 17 00:00:00 2001
From: Mathias Chouet <mathias.chouet@irstea.fr>
Date: Thu, 19 Mar 2020 16:39:30 +0100
Subject: [PATCH] CI: try using artifacts for passing dist/ folder from build
 to deploy

---
 .gitlab-ci.yml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 197ed85f0..e6e344bdd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,7 +20,6 @@ variables:
 cache:
   paths:
     - node_modules/
-    - dist/
 
 jalhyd:
   stage: jalhyd
@@ -69,6 +68,10 @@ build:
     - tags
     - schedules
     - web
+  artifacts:
+    expire_in: 10 min
+    paths:
+      - dist/
   script:
     - npm run build -- --base-href=/cassiopee/$CI_COMMIT_REF_NAME
 
@@ -78,6 +81,8 @@ deploy:
     - pushes
     - tags
     - web
+  dependencies:
+    - build
   script:
     # Copie de la branche / du tag
     - rsync -a "dist/" "$DEPLOY_HOST_LOGIN:$DEPLOY_URL/$CI_COMMIT_REF_NAME"
@@ -87,6 +92,8 @@ deploy-stable:
   only:
     variables:
       - $CI_COMMIT_REF_NAME == "stable"
+  dependencies:
+    - build
   script:
     # Copie de la branche production
     - rsync -a "dist/" "$DEPLOY_HOST_LOGIN:$DEPLOY_STABLE_URL/"
@@ -97,6 +104,7 @@ releases-nightly:
   stage: releases-nightly
   only:
     - schedules
+  dependencies: []
   script:
     - npm run release-all
     - find release -name "fr.irstea.cassiopee_*.deb" -exec scp "{}" $DEPLOY_HOST_LOGIN:$RELEASES_URL/linux-nightly.deb \;
@@ -109,5 +117,6 @@ releases-version:
   only:
     variables:
       - $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag
+  dependencies: []
   script:
     - nodejs scripts/release-version.sh $CI_COMMIT_REF_NAME $DEPLOY_HOST_LOGIN $RELEASES_URL
-- 
GitLab