-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No need for garbage collection since one temporary project is allocated with 1h of lifespan for each run. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com> Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023 The Flatcar Maintainers. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
set -euo pipefail | ||
|
||
# Test execution script for the Hetzner vendor. | ||
# This script is supposed to run in the mantle container. | ||
|
||
source ci-automation/vendor_test.sh | ||
|
||
hetzner_instance_type_var="HETZNER_${CIA_ARCH}_INSTANCE_TYPE" | ||
hetzner_instance_type="${!hetzner_instance_type_var}" | ||
|
||
# HETZNER_TPS_TOKEN should be provided by sdk_container/.env | ||
|
||
# We first need to create a temporary project using HETZNER_TPS_TOKEN | ||
# When the project is created it returns a regular HETZNER_TOKEN that can be used | ||
# in the next commands, it is a token similar to what you would get in your Hetzner console. | ||
HETZNER_TOKEN=$(curl \ | ||
--fail-with-body \ | ||
--retry 2 \ | ||
--silent \ | ||
--user-agent "flatcar-ci/unknown" \ | ||
--request POST \ | ||
--header "Authorization: Bearer ${HETZNER_TPS_TOKEN}" \ | ||
https://tps.hc-integrations.de | ||
) | ||
|
||
# Upload the image on Hetzner. | ||
IMAGE_ID=$(ore hetzner \ | ||
--hetzner-token="${HETZNER_TOKEN}" \ | ||
--hetzner-location="${HETZNER_LOCATION}" \ | ||
create-image \ | ||
--board="${CIA_ARCH}-usr" \ | ||
--name flatcar-"${CIA_VERNUM}" \ | ||
--file="https://${BUILDCACHE_SERVER}/images/${CIA_ARCH}/${CIA_VERNUM}/${HETZNER_IMAGE_NAME}" | ||
) | ||
|
||
kola_test_basename="ci-${CIA_VERNUM//+/-}" | ||
kola_test_basename="${kola_test_basename//[+.]/-}" | ||
|
||
set -x | ||
|
||
timeout --signal=SIGQUIT 2h kola run \ | ||
--board="${CIA_ARCH}-usr" \ | ||
--parallel="${HETZNER_PARALLEL}" \ | ||
--tapfile="${CIA_TAPFILE}" \ | ||
--channel="${CIA_CHANNEL}" \ | ||
--basename="${kola_test_basename}" \ | ||
--platform=hetzner \ | ||
--hetzner-token="${HETZNER_TOKEN}" \ | ||
--hetzner-server-type="${hetzner_instance_type}" \ | ||
--hetzner-location="${HETZNER_LOCATION}" \ | ||
--hetzner-image=${IMAGE_ID} | ||
"${@}" | ||
|
||
set +x |