From 2d3598cf4a2cbe566d1f0aefca6da60e3d267310 Mon Sep 17 00:00:00 2001
From: Romain Deville <code@romaindeville.fr>
Date: Wed, 19 May 2021 10:41:52 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Update=20pagoda=20CI=20template?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 user_config/.gitlab-ci.yml      | 10 +++++++---
 user_config/docs/.gitlab-ci.yml | 17 +++++++++++------
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/user_config/.gitlab-ci.yml b/user_config/.gitlab-ci.yml
index 0ed8f5a..f2e900e 100644
--- a/user_config/.gitlab-ci.yml
+++ b/user_config/.gitlab-ci.yml
@@ -56,7 +56,7 @@ variables:
 # Before scripts anchors
 # -----------------------------------------------------------------------------
 # https://docs.gitlab.com/ee/ci/yaml/README.html#before_script
-.before_script_python_dependencies: &before_script_python_dependencies
+.before_script_python_dependencies_main: &before_script_python_dependencies_main
   before_script:
     # Add python dependencies
     - apk update
@@ -69,6 +69,10 @@ variables:
         bash
         git
         gcc
+        libffi-dev
+        musl-dev
+        openssl-dev
+        cargo
     # Create virtual environment
     - virtualenv .venv
     # Activate virtual environment
@@ -138,7 +142,7 @@ test_tox_format_python:
   <<: *tag_docker
   <<: *image_docker
   <<: *stage_test
-  <<: *before_script_python_dependencies
+  <<: *before_script_python_dependencies_main
   script:
     # Install python tox
     - pip3 install tox
@@ -149,7 +153,7 @@ test_tox_format_shell:
   <<: *tag_docker
   <<: *image_docker
   <<: *stage_test
-  <<: *before_script_python_dependencies
+  <<: *before_script_python_dependencies_main
   script:
     # Install python tox
     - pip3 install tox
diff --git a/user_config/docs/.gitlab-ci.yml b/user_config/docs/.gitlab-ci.yml
index c74c50f..5bab534 100644
--- a/user_config/docs/.gitlab-ci.yml
+++ b/user_config/docs/.gitlab-ci.yml
@@ -46,7 +46,7 @@ variables:
 # Before scripts anchors
 # -----------------------------------------------------------------------------
 # https://docs.gitlab.com/ee/ci/yaml/README.html#before_script
-.before_script_python_dependencies: &before_script_python_dependencies
+.before_script_python_dependencies_docs: &before_script_python_dependencies_docs
   # Add python dependencies
   - apk update
   # Install base package required for mkdocs builds
@@ -261,7 +261,7 @@ test_build_local:
   <<: *cache_python
   <<: *stage_test
   before_script:
-    - *before_script_python_dependencies
+    - *before_script_python_dependencies_docs
   script:
     # Install python test requirements
     - pip3 install -r requirements.docs.txt
@@ -277,7 +277,7 @@ test_build:
   <<: *cache_python
   <<: *stage_test
   before_script:
-    - *before_script_python_dependencies
+    - *before_script_python_dependencies_docs
   script:
     # Install python test requirements
     - pip3 install -r requirements.docs.txt
@@ -292,7 +292,7 @@ build_html:
   <<: *cache_python_pull
   <<: *stage_build
   before_script:
-    - *before_script_python_dependencies
+    - *before_script_python_dependencies_docs
   script:
     # Install python documentations requirements
     - pip3 install -r requirements.docs.txt
@@ -317,8 +317,13 @@ script_deploy_html: &script_deploy_html
   script:
     - git fetch --all
     - export LAST_TAG="$(git describe --tags `git rev-list --tags --max-count=1`)"
-    - export LAST_TAG="${LAST_TAG/v/}"
-    - export LAST_TAG="${LAST_TAG%.*}"
+    - if [[ -z "${LAST_TAG}" ]]
+      then
+        export LAST_TAG="-1.-1"
+      else
+        export LAST_TAG="${LAST_TAG/v/}"
+        export LAST_TAG="${LAST_TAG%.*}"
+      fi
     - |
       case "${CI_DEPLOY_TYPE}" in
         "dev")
-- 
GitLab