From 1ad5e91dc815e4740f92c99917458d0bb9d8eae9 Mon Sep 17 00:00:00 2001
From: Carlos Vega <vegamorenocarlos@gmail.com>
Date: Fri, 20 Oct 2023 13:43:21 +0200
Subject: [PATCH] Add stage for debian bookworm in .gitlab-ci.yml

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

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6770b30b..7442b7aa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -211,6 +211,35 @@ test_install_debian_package_debian_buster:
      - test 302 = $(curl -X GET --write-out %{http_code} --silent --output /dev/null http://localhost:8888/)
      - test 200 = $(curl -X GET --write-out %{http_code} --silent --output /dev/null http://localhost:8888/account/login/?next=/)
 
+test_install_debian_package_debian_bookworm:
+  image: debian:bookworm
+  stage: test
+  only:
+    - tags
+  services:
+     - name: piotrgawron/debian-repo
+       alias: debian-repo
+  dependencies:
+     - build_debian
+  script:
+     - apt-get update
+     - DEBIAN_FRONTEND=noninteractive apt-get install -y ssh software-properties-common dirmngr wget curl
+     - debian_file=$(ls *.deb)
+     - echo "PUT $debian_file /docker/incoming" | sftp -o StrictHostKeyChecking=no user@debian-repo
+     - ssh root@debian-repo /usr/local/sbin/reprepro-import
+     - apt-add-repository "deb http://debian-repo/ unstable main"
+     - apt-get update --allow-insecure-repositories
+     - DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated smasch
+#systemd is not available on docker so we need to start manually gunicorn (smasch.service is not tested)
+     - cd /usr/lib/smasch/
+     - /usr/lib/smasch/env/bin/gunicorn -b 127.0.0.1:8888 --pid smasch.pid smash.wsgi --error-logfile /var/log/smasch/gunicorn.log --log-level DEBUG --capture-output --limit-request-line 8192 &
+#we need to wait a bit for gunicorn start
+     - sleep 15
+     - wget http://localhost:8888/account/login/?next=/
+#test if we can login and list projects
+     - test 302 = $(curl -X GET --write-out %{http_code} --silent --output /dev/null http://localhost:8888/)
+     - test 200 = $(curl -X GET --write-out %{http_code} --silent --output /dev/null http://localhost:8888/account/login/?next=/)
+
 test_version_in_base_html:
    script:
      - CURRENT_VERSION=`cat CHANGELOG |grep smasch |head -1 | cut -f2 -d'(' | cut -f1 -d')' | cut -f1 -d'-' `
-- 
GitLab