From 4d73472b3725e9488f73c4b5139019605b038568 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lestin=20Matte?= <celestin.matte@gmail.com>
Date: Thu, 17 Aug 2023 11:43:29 +0200
Subject: [PATCH 2/2] Add .gitlab-ci.yml

---
 .gitlab-ci.yml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..9c6b037
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,23 @@
+stages:
+  - test
+  - deploy
+
+validate syntax:
+  stage: test
+  image: "debian:bookworm"
+  before_script:
+    - apt-get update -qq && apt-get install -y -qq pycodestyle
+  script:
+    - (for X in $(find . -name "*.py" -not -path "./loader/legacy/*") ; do cat $X | python3 -c "import sys, os; compile(sys.stdin.read(), sys.argv[1], 'exec')" $X ||exit 1 ; done)
+    - pycodestyle -v .
+
+validate deployment upstream:
+  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 pgarchives
+    - wget -O - --no-check-certificate https://localhost | grep 'View All Archives'
-- 
2.41.0

