From ef5919cdaba15e00068e658ff1c03d298d615b6f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 9 Nov 2020 07:18:32 +1000 Subject: [PATCH] gitlab CI: switch to the vmctl script See ci-templates commit acda94e139030dc2caa058118956225e55bbec5f, it replaces vm interactions with vmctl start/stop/exec and sets up an ssh config for the hostname 'vm'. Signed-off-by: Peter Hutterer --- .gitlab-ci.yml | 14 ++++++-------- .gitlab-ci/ci.template | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15e563a1..e4e40fb1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -443,27 +443,25 @@ freebsd:11.2@container-clean: - echo "Testing $SUITES" script: # start our vm, no args required - - /app/start_vm.sh || (echo "Error - Failed to start the VM." && exit 1) + - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1) - *check_tainted - - "scp -P 5555 -r $PWD localhost:" + - "scp -r $PWD vm:" - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv - echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS $SUITES\"" >> sshenv - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv - - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment" - - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true + - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment" + - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true # no matter the results of the tests, we want to fetch the logs - - scp -P 5555 -r localhost:$CI_PROJECT_NAME/$MESON_BUILDDIR . + - scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR . - *check_tainted - - ssh localhost -p 5555 halt || true - - sleep 2 - - pkill qemu || true + - /app/vmctl stop - if [[ ! -e .success ]] ; then diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index f7e50c95..62312067 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -374,27 +374,25 @@ freebsd:11.2@container-clean: - echo "Testing $SUITES" script: # start our vm, no args required - - /app/start_vm.sh || (echo "Error - Failed to start the VM." && exit 1) + - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1) - *check_tainted - - "scp -P 5555 -r $PWD localhost:" + - "scp -r $PWD vm:" - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv - echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS $SUITES\"" >> sshenv - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv - - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment" - - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true + - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment" + - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true # no matter the results of the tests, we want to fetch the logs - - scp -P 5555 -r localhost:$CI_PROJECT_NAME/$MESON_BUILDDIR . + - scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR . - *check_tainted - - ssh localhost -p 5555 halt || true - - sleep 2 - - pkill qemu || true + - /app/vmctl stop - if [[ ! -e .success ]] ; then