From 43a1d7d58ddf6cd424a7aa919807aa91eb247e00 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 5 Aug 2021 17:17:51 +0200 Subject: [PATCH] Fix CI and test UEFI too --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae6198b..5ef0725 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: debian:latest +image: debian:stretch build: stage: build @@ -7,12 +7,13 @@ build: - DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 install --no-install-recommends -qq libguestfs-tools busybox linux-image-amd64 gnupg1 openssh-client - ssh-keygen -q -N '' -f ~/.ssh/id_rsa script: - - 'LIBGUESTFS_BACKEND=direct virt-builder --gpg /usr/bin/gpg1 --arch x86_64 debian-9 -o debian.raw --root-password password:root --ssh-inject root --install wget,ca-certificates --firstboot-command "dpkg-reconfigure openssh-server"' + - curl -fOL https://cdimage.debian.org/cdimage/cloud/buster/latest/debian-10-nocloud-amd64.qcow2 + - 'LIBGUESTFS_BACKEND=direct virt-customize -a debian-10-nocloud-amd64.qcow2 --root-password password:root --ssh-inject root --install wget,ca-certificates --firstboot-command "dpkg-reconfigure -f noninteractive openssh-server"' after_script: - mv ~/.ssh/id_rsa id_rsa cache: paths: - - debian.raw + - debian-10-nocloud-amd64.qcow2 - id_rsa policy: push @@ -25,15 +26,38 @@ build: - mkdir ~/.ssh - mv id_rsa ~/.ssh/id_rsa - printf '%s\n\t' 'Host *' 'ServerAliveInterval 15' 'UserKnownHostsFile /dev/null' 'StrictHostKeyChecking no' 'CheckHostIP no' > ~/.ssh/config - - qemu-system-x86_64 -m 256 -daemonize -drive file=debian.raw,if=virtio -net nic -net user,hostfwd=tcp::10022-:22 -display none -vga none - - sleep 60 + - qemu-system-x86_64 -m 256 -daemonize -drive file=debian-10-nocloud-amd64.qcow2,if=virtio -net nic -net user,hostfwd=tcp::10022-:22 -display none -vga none -serial file:/tmp/serial + - 'tail -f /tmp/serial &' + - sleep 120 - scp -P 10022 vps2arch root@127.0.0.1:vps2arch - ssh -p 10022 root@127.0.0.1 "chmod +x vps2arch" dependencies: - build cache: paths: - - debian.raw + - debian-10-nocloud-amd64.qcow2 + - id_rsa + policy: pull + +.tests_uefi: + retry: 1 + stage: test + before_script: + - apt-get update -y + - DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retires=10 install --no-install-recommends -qq qemu-system-x86 openssh-client ovmf sshpass + - mkdir ~/.ssh + - mv id_rsa ~/.ssh/id_rsa + - printf '%s\n\t' 'Host *' 'ServerAliveInterval 15' 'UserKnownHostsFile /dev/null' 'StrictHostKeyChecking no' 'CheckHostIP no' > ~/.ssh/config + - qemu-system-x86_64 -m 256 -daemonize -bios /usr/share/OVMF/OVMF_CODE.fd -drive file=debian-10-nocloud-amd64.qcow2,if=virtio -net nic -net user,hostfwd=tcp::10022-:22 -display none -vga none -serial file:/tmp/serial + - 'tail -f /tmp/serial &' + - sleep 120 + - scp -P 10022 vps2arch root@127.0.0.1:vps2arch + - ssh -p 10022 root@127.0.0.1 "chmod +x vps2arch" + dependencies: + - build + cache: + paths: + - debian-10-nocloud-amd64.qcow2 - id_rsa policy: pull @@ -57,3 +81,10 @@ test_syslinux: - 'ssh -p 10022 root@127.0.0.1 "./vps2arch -b syslinux && sync ; reboot -f" || true' - sleep 600 - sshpass -proot ssh -p 10022 root@127.0.0.1 test -f /etc/arch-release + +test_default_uefi: + extends: .tests_uefi + script: + - 'ssh -p 10022 root@127.0.0.1 "./vps2arch && sync ; reboot -f" || true' + - sleep 600 + - sshpass -proot ssh -p 10022 root@127.0.0.1 test -f /etc/arch-release