From ade3e4293c94c808dd74c94a1800501ef8a9b585 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Fri, 25 Jul 2025 15:59:44 +1000 Subject: [PATCH] build: Add virt-install steps --- .gitea/workflows/actions.yaml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 6793f8b..40ba8f2 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -50,8 +50,11 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + - name: Create folder structure + run: | + mkdir -p \ + ubuntu-vm - name: Generate seed ISO - shell: bash run: | apt-get update && \ apt-get install -y \ @@ -60,14 +63,38 @@ jobs: envsubst < cloud-init/user-data.template > cloud-init/user-data genisoimage \ - -output seed.iso \ + -output ubuntu-vm/seed.iso \ -volid cidata \ -joliet \ -rock \ cloud-init/meta-data cloud-init/user-data + + ls -lash ubuntu-vm env: ROOT_HASHED_PASSWORD: ${{ secrets.ROOT_HASHED_PASSWORD }} PUBLIC_SSHKEY: ${{ secrets.PUBLIC_SSHKEY }} + - name: Download Ubuntu ISO + run: | + if [ ! -f ubuntu-vm/ubuntu-24.04.iso ]; then + curl -L -o ubuntu-vm/ubuntu-24.04.iso https://releases.ubuntu.com/24.04/ubuntu-24.04.2-desktop-amd64.iso + fi + - name: Create empty QCOW2 disk + run: | + qemu-img create -f qcow2 ubuntu-vm/ubuntu.qcow2 10G + - name: Run virt-install + run: | + virt-install \ + --name ubuntu-harvester \ + --ram 2048 \ + --vcpus 2 \ + --disk path=ubuntu-vm/ubuntu.qcow2,size=10,format=qcow2 \ + --disk path=ubuntu-vm/seed.iso,device=cdrom \ + --cdrom ubuntu-vm/ubuntu-24.04.iso \ + --os-variant ubuntu24.04 \ + --graphics none \ + --network network=default \ + --noautoconsole \ + --wait -1 # semrel: # name: Semantic Release