Skip to content
Snippets Groups Projects

gitlab_runner: Add VM based executor (libvirt-executor)

Merged Kristian Klausen requested to merge klausenbusk/infrastructure:custom-executor into master
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
@@ -101,7 +101,7 @@ prepare() {
echo "Error no VM template found"
exit 1
fi
vm_name="foo"
vm_name="$(get_vm_name)"
if ! virt-clone -o "${vm_template}" -n "${vm_name}" --auto-clone --reflink; then
virt-clone -o "${vm_template}" -n "${vm_name}" --auto-clone
fi
@@ -111,14 +111,14 @@ prepare() {
# https://docs.gitlab.com/runner/executors/custom.html#run
run() {
vm_name="foo"
vm_name="$(get_vm_name)"
wait_for_ssh "${vm_name}"
ssh bash < "${1}" || exit "${BUILD_FAILURE_EXIT_CODE:-1}"
}
# https://docs.gitlab.com/runner/executors/custom.html#cleanup
cleanup() {
vm_name="foo"
vm_name="$(get_vm_name)"
virsh destroy "${vm_name}" || true
virsh undefine "${vm_name}" --remove-all-storage
}
Loading