Skip to content
Snippets Groups Projects
Verified Commit 52121d34 authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

Merge branch 'libvirt-executor-image' into 'master'

Add libvirt-executor image for our GitLab Runner custom executor

See merge request !200
parents 48ccb457 edee5ef6
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@ shfmt:
name: "output"
paths:
- "output/*"
# Workaround until https://gitlab.com/gitlab-org/gitlab/-/issues/352644 is sorted
- build.env
expire_in: 2d
reports:
metrics: metrics.txt
......@@ -186,7 +188,9 @@ publish:
- pacman -Syu --needed --noconfirm vagrant
script:
- |
for file in output/*; do
shopt -s extglob
# The libvirt-executor image is not meant for external consumption!
for file in output/!(*libvirt-executor*); do
base="$(basename "${file}")"
curl -sSf --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${file}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/images/v${BUILD_VERSION}/${base}"
done
......
#!/bin/bash
# shellcheck disable=SC2034,SC2154
IMAGE_NAME="Arch-Linux-x86_64-libvirt-executor-${build_version}.qcow2"
DISK_SIZE="40G"
PACKAGES=(git git-lfs gitlab-runner)
SERVICES=()
function pre() {
arch-chroot "${MOUNT}" /usr/bin/systemctl disable systemd-time-wait-sync
sed -E 's/^#(IgnorePkg *=)/\1 linux/' -i "${MOUNT}/etc/pacman.conf"
sed 's/^\(GRUB_CMDLINE_LINUX=".*\)"$/\1 lockdown=confidentiality"/' -i "${MOUNT}/etc/default/grub"
arch-chroot "${MOUNT}" /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
# We want to use the transient hostname
# https://github.com/systemd/systemd/pull/30814
rm -f "${MOUNT}/etc/hostname"
cat <<EOF >"${MOUNT}/etc/systemd/network/80-dhcp.network"
[Match]
Name=en*
Name=eth*
[Network]
DHCP=yes
EOF
}
function post() {
qemu-img convert -c -f raw -O qcow2 "${1}" "${2}"
rm "${1}"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment