ci: test against trixie (#78771)
gitea/publik-devinst/pipeline/head There was a failure building this commit Details

This commit is contained in:
Frédéric Péters 2023-06-20 14:39:41 +02:00
parent fc6364fb7f
commit c5634d132f
2 changed files with 7 additions and 5 deletions

4
Jenkinsfile vendored
View File

@ -4,10 +4,10 @@ pipeline {
agent any
options { disableConcurrentBuilds() }
stages {
stage('Unit Tests (bullseye)') {
stage('Unit Tests (trixie)') {
steps {
catchError(stageResult: 'FAILURE') {
sh 'sudo ./test-nspawn bullseye'
sh 'sudo ./test-nspawn trixie'
}
}
}

View File

@ -1,19 +1,21 @@
#!/bin/sh
set -ex
if [ $1 = bullseye ] || [ $1 = bookworm ]
if [ $1 = trixie ] || [ $1 = bookworm ]
then
suite=$1
image=publik-devinst-$suite
fs=/var/lib/machines/$image
test -d $fs || (cd /var/lib/machines && debootstrap --include=systemd-container $suite $image http://deb.debian.org/debian/)
if [ $suite = trixie ]; then suite=testing; fi
test -d $fs || (cd /var/lib/machines && debootstrap --include=systemd-container,dbus $suite $image http://deb.debian.org/debian/)
rsync -a --delete . $fs/opt/publik-devinst
systemd-nspawn -x -D $fs /opt/publik-devinst/test-nspawn run-tests
elif [ $1 = 'run-tests' ]
then
apt update
apt full-upgrade -y
apt install -y wget ca-certificates gnupg2 git ansible postgresql sudo python3
if grep -q 12 /etc/debian_version; then ANSIBLE_PACKAGE=ansible; else ANSIBLE_PACKAGE=ansible-core; fi
apt install -y wget ca-certificates gnupg2 git $ANSIBLE_PACKAGE postgresql sudo python3
id testuser || adduser --disabled-password --gecos "" testuser
usermod -a -G sudo testuser
grep -q testuser /etc/sudoers || echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers