Commit 33acdc19 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Add a stop_vm.sh script to match the existing start_vm.sh script



It's only a few lines but we might as well balance this.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent ca99d941
......@@ -68,7 +68,7 @@ include:
variables:
BOOTSTRAP_TAG: '2020-03-17'
QEMU_TAG: '2020-03-17'
QEMU_TAG: '2020-03-18'
stages:
......
......@@ -101,9 +101,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
# start the VM, with the kernel parameters
- bash /app/start_vm_kernel.sh
......@@ -111,9 +109,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
artifacts:
name: logs-$CI_PIPELINE_ID
when: always
......
......@@ -101,9 +101,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
# start the VM, with the kernel parameters
- bash /app/start_vm_kernel.sh
......@@ -111,9 +109,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
artifacts:
name: logs-$CI_PIPELINE_ID
when: always
......
......@@ -101,9 +101,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
# start the VM, with the kernel parameters
- bash /app/start_vm_kernel.sh
......@@ -111,9 +109,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
artifacts:
name: logs-$CI_PIPELINE_ID
when: always
......
......@@ -73,12 +73,7 @@ ssh localhost -p 5555 git clone https://github.com/systemd/mkosi.git
# arch / qemu is disabled until it gets fixed
# stop the vm and compress the image file
ssh localhost -p 5555 halt -p || true
while pgrep qemu
do
sleep 2
done
/app/stop_vm.sh
# manually compress the image with `-T0` to use multithreading
xz -T0 /app/image.raw
......
......@@ -46,3 +46,14 @@ exit \$exit_code
EOF
chmod +x /app/start_vm.sh
cat > /app/stop_vm.sh <<EOF
#!/bin/bash
set -x
ssh localhost -p 5555 halt
sleep 2
pkill qemu
EOF
chmod +x /app/stop_vm.sh
......@@ -293,11 +293,8 @@ on port ``5555``.
# copy any test results from the VM to our container so we can
# save them as artifacts
- scp -P 5555 -r localhost:$CI_PROJECT_NAME/test-results.xml .
# shut down the vm, give it time to shut down and then kill it if
# it's still running
- ssh localhost -p 5555 halt
- sleep 2
- pkill qemu
# shut down the VM
- /app/stop_vm.sh
# VM cleanup is complete, any command failures now should result in
# a CI failed job
- set -e
......
......@@ -136,4 +136,4 @@ globals:
bootstrap_tag: '2020-03-17'
## @qemu_tag: the current image tag associated with this qemu bootstrap image
qemu_tag: '2020-03-17'
qemu_tag: '2020-03-18'
......@@ -108,9 +108,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
# start the VM, with the kernel parameters
- bash /app/start_vm_kernel.sh
......@@ -118,9 +116,7 @@
- ssh -p 5555 localhost curl --insecure https://gitlab.freedesktop.org
- ssh -p 5555 localhost wget --no-check-certificate https://gitlab.freedesktop.org
# terminate the VM
- ssh -p 5555 localhost halt -p || true
- sleep 2
- kill $(pgrep qemu) || true
- bash /app/stop_vm.sh
artifacts:
name: logs-$CI_PIPELINE_ID
when: always
......
......@@ -278,7 +278,7 @@
extends: .fdo.container-build@debian
tags:
- kvm
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-17
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-18
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -375,7 +375,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-17}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-18}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
......@@ -268,7 +268,7 @@
extends: .fdo.container-build@fedora
tags:
- kvm
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-17
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-18
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -366,7 +366,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-17}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-18}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
......@@ -277,7 +277,7 @@
extends: .fdo.container-build@ubuntu
tags:
- kvm
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-17
image: $CI_REGISTRY/freedesktop/ci-templates/qemu-mkosi-base:2020-03-18
script:
# log in to the registry
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
......@@ -419,7 +419,7 @@
graphroot = "/var/lib/containers/storage"
EOF
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-17}
- QEMU_BASE_IMAGE=${QEMU_BASE_IMAGE:-$CI_REGISTRY/freedesktop/ci-templates/qemu-base:2020-03-18}
- echo Building $FDO_REPO_SUFFIX:$DISTRO_TAG from $QEMU_BASE_IMAGE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment