ci: use debvm (#72899)
gitea/publik-devinst/pipeline/head There was a failure building this commit
Details
gitea/publik-devinst/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
50515ea194
commit
b986301e64
|
@ -7,14 +7,14 @@ pipeline {
|
|||
stage('Unit Tests (bullseye)') {
|
||||
steps {
|
||||
catchError(stageResult: 'FAILURE') {
|
||||
sh 'sudo ./test-nspawn bullseye'
|
||||
sh './test-debvm bookworm'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Unit Tests (bookworm)') {
|
||||
steps {
|
||||
catchError(stageResult: 'FAILURE') {
|
||||
sh 'sudo ./test-nspawn bookworm'
|
||||
sh './test-debvm trixie'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh -ex
|
||||
# USAGE : ./test-debvm bookworm
|
||||
|
||||
if [ $1 = bookworm ] || [ $1 = trixie ]
|
||||
then
|
||||
SUITE=$1
|
||||
debvm-create --release=$SUITE --size=10G --sshkey=$HOME/.ssh/id_rsa.pub -- --include=ca-certificates,gnupg2,linux-image-generic,locales-all,postgresql,sudo,git,ansible,make --hook-dir=/usr/share/mmdebstrap/hooks/9pmount --mode=unshare
|
||||
debvm-run -g --sshport 2222 -- -daemonize -display none -virtfs "local,path=.,mount_tag=publik-devinst,security_model=none"
|
||||
debvm-waitssh 2222
|
||||
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@localhost "cd /media/publik-devinst;./test-debvm run-tests"
|
||||
kill `ps ax | grep "qemu-system-x86_64" | awk 'NR==1{print $1}'`
|
||||
rm rootfs.ext4
|
||||
elif [ $1 = 'run-tests' ]
|
||||
then
|
||||
adduser --disabled-password --gecos "" testuser
|
||||
usermod -a -G sudo testuser
|
||||
echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
PORT=`pg_lsclusters | tail -n1 | awk '{ print $3 }'`
|
||||
su testuser -l -c 'cd /media/publik-devinst; ansible-playbook -e "postgresql_port=$PORT" -i inventory.yml install.yml'
|
||||
fi
|
Loading…
Reference in New Issue