From be54ef41cb19bc862c2a966695ed58f3ea541cb3 Mon Sep 17 00:00:00 2001
From: Daniel Hornung <d.hornung@indiscale.com>
Date: Mon, 5 Jul 2021 10:19:57 +0200
Subject: [PATCH] STY DOC: Reordered .gitlab-ci.yml, added a bit of
 documentation.

---
 .gitlab-ci.yml | 61 +++++++++++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 26 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bd2016e..48a588d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,31 +32,7 @@ stages:
   - test
   - deploy
 
-# Trigger building of server image and integration tests
-trigger_build:
-  tags: [ docker ]
-  stage: deploy
-  script:
-    - /usr/bin/curl -X POST
-      -F token=$CI_JOB_TOKEN
-      -F "variables[F_BRANCH]=$CI_COMMIT_REF_NAME"
-      -F "variables[MYSQLBACKEND]=$CI_COMMIT_REF_NAME"
-      -F "variables[TriggerdBy]=MYSQLBACKEND"
-      -F "variables[TriggerdByHash]=$CI_COMMIT_SHORT_SHA"
-      -F ref=$DEPLOY_REF https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline
-
-unittests:
-  tags: [ docker ]
-  stage: test
-  script:
-    - cp config.defaults .config
-    - echo 'DATABASE_USER_HOST_LIST="%,"' >> .config
-    - echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config
-    - echo "MYSQL_HOST=mariadb" >> .config
-    - sleep 10
-    - make install
-    - ./utils/make_db restore_db tests/example.dump.sql
-    - ./tests/test_utils.sh
+######## Setup ########
 
 # Build a docker image in which tests for this repository can run
 build-testenv:
@@ -75,6 +51,40 @@ build-testenv:
       -t $CI_REGISTRY_IMAGE .
     - docker push $CI_REGISTRY_IMAGE
 
+
+######## Test ########
+
+# Run the unit tests
+unittests:
+  tags: [ docker ]
+  stage: test
+  script:
+    - cp config.defaults .config
+    - echo 'DATABASE_USER_HOST_LIST="%,"' >> .config
+    - echo "MYSQL_USER_PASSWORD=$MYSQL_ROOT_PASSWORD" >> .config
+    - echo "MYSQL_HOST=mariadb" >> .config
+    - sleep 10
+    - make install
+    - ./utils/make_db restore_db tests/example.dump.sql
+    - ./tests/test_utils.sh
+
+
+######## Deploy ########
+
+# Trigger building of server image and integration tests
+trigger_build:
+  tags: [ docker ]
+  stage: deploy
+  script:
+    - /usr/bin/curl -X POST
+      -F token=$CI_JOB_TOKEN
+      -F "variables[F_BRANCH]=$CI_COMMIT_REF_NAME"
+      -F "variables[MYSQLBACKEND]=$CI_COMMIT_REF_NAME"
+      -F "variables[TriggerdBy]=MYSQLBACKEND"
+      -F "variables[TriggerdByHash]=$CI_COMMIT_SHORT_SHA"
+      -F ref=$DEPLOY_REF https://gitlab.indiscale.com/api/v4/projects/14/trigger/pipeline
+
+
 # Build the sphinx documentation and make it ready for deployment by Gitlab Pages
 # Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
 pages_prepare: &pages_prepare
@@ -95,4 +105,3 @@ pages:
   only:
     refs:
       - main
-
-- 
GitLab