From 247940363a2d24517e0e36a754f0783faca32f69 Mon Sep 17 00:00:00 2001
From: Lucas Nussbaum <lucas.nussbaum@inria.fr>
Date: Tue, 7 Jan 2025 14:40:01 +0100
Subject: [PATCH] [ci] reorganize jobs

We deploy first to make changes available fast. It makes no sense to
wait until the checks succeeded before deploying, because the deployment
process synchronizes all branches: another pipeline (for another branch)
could trigger the deployment of the current branch if it is broken.
---
 .gitlab-ci.yml | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 361067d17b8..60a2f09a28c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,10 +1,9 @@
 ---
 stages:
+  - deploy-to-api-servers
   - lint
-  - validate
-  - generate
-  - deploy
-  - checks
+  - check
+  - generate-access-history
 
 include:
   - project: 'grid5000/grid5000-gitlab-templates'
@@ -31,9 +30,9 @@ include:
     - wget --no-check-certificate -q https://www.grid5000.fr/certs/ca2019.grid5000.fr.crt -O /usr/local/share/ca-certificates/ca2019.grid5000.fr.crt
     - /usr/sbin/update-ca-certificates
 
-validate-data:
+validate-input-data:
   extends: .template-refrepo
-  stage: validate
+  stage: check
   script:
     - bundle exec rake valid:schema
     - bundle exec rake valid:duplicates
@@ -41,7 +40,7 @@ validate-data:
 
 wikigen:
   extends: .template-refrepo
-  stage: checks
+  stage: check
   allow_failure: true
   parallel:
     matrix:
@@ -58,9 +57,9 @@ wikigen:
     refs:
       - master
 
-generate-reference-api:
+check-no-changes-in-data:
   extends: .template-refrepo
-  stage: generate
+  stage: check
   script:
     - export TZ=Europe/Paris
     - bundle exec rake reference-api
@@ -71,7 +70,7 @@ generate-reference-api:
 
 generate-access-history:
   extends: .template-refrepo
-  stage: generate
+  stage: generate-access-history
   script:
     - export TZ=Europe/Paris
     - bundle exec rake gen:accesses-history
@@ -80,22 +79,22 @@ generate-access-history:
       - data/grid5000/accesses/accesses_mode_history.yaml
     expire_in: 1 week
 
-deploy:
-  stage: deploy
+deploy-to-api-servers:
+  stage: deploy-to-api-servers
   tags:
     - grid5000-shell
   script:
     - /srv/ci-runner-scripts/bin/update-api-servers
 
 rspec:
-  stage: checks  # we use 'checks' here to avoid blocking on this when updating the ref-repo
+  stage: check  # we use 'checks' here to avoid blocking on this when updating the ref-repo
   extends: .template-refrepo
   script:
     - export TZ=Europe/Paris
     - bundle exec rspec
 
 valid-homogeneity:
-  stage: checks
+  stage: check
   extends: .template-refrepo
   script:
     - bundle exec rake valid:homogeneity
-- 
GitLab