From 4a05cd484822d01c27fe2736e8c65f4b62fe06e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lestin=20Matte?= <celestin.matte@gmail.com>
Date: Tue, 15 Aug 2023 11:50:35 +0200
Subject: [PATCH 1/3] .gitlab-ci: add stage to validate deployment

---
 .gitlab-ci.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7f31de4..d32f803 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 stages:
   - test
+  - deploy
 
 validate syntax:
   stage: test
@@ -9,3 +10,14 @@ validate syntax:
   script:
     - (for X in $(find . -name "*.py") ; do cat $X | python3 -c "import sys, os; compile(sys.stdin.read(), sys.argv[1], 'exec')" $X ||exit 1 ; done)
     - pep8 -v .
+
+validate deployment:
+  stage: deploy
+  image: "debian:bookworm"
+  before_script:
+    - apt-get update -qq && apt-get install -y -qq git gpg ansible sudo wget
+  script:
+    - git clone https://gitlab.com/cmatte/ansible-pglister.git
+    - ansible-galaxy role install cchurch.django
+    - cd ansible-pglister && ansible-playbook -vvv -i localhost.ini gitlab-ci.yml --tags pglister
+    - wget -O - --no-check-certificate https://localhost | grep 'From this site you can manage all your'
-- 
2.41.0

