Merge pull request #305 from flatcar-linux/kai/tormath1/pxe-plus-test-script-names

ci-automation/vms: handle platform names and generate the image formats
This commit is contained in:
Kai Lüke 2022-04-28 18:00:20 +09:00 committed by GitHub
commit 60d74ceacd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,10 +69,20 @@ function vm_build() {
[[ ${has_packet} -eq 1 ]] && [[ ${has_pxe} -eq 0 ]] && set -- 'pxe' "${@}"
for format; do
# keep compatibility with SDK scripts where "equinix_metal"
# remains unknown.
[ "${format}" = "equinix_metal" ] && format="packet"
# Convert platform names (also used to find the test scripts) to image formats they entail
formats="$*"
if echo "$formats" | tr ' ' '\n' | grep -q '^vmware'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/vmware.*/d')
formats+=" vmware vmware_insecure vmware_ova vmware_raw"
fi
if echo "$formats" | tr ' ' '\n' | grep -q -P '^(ami|aws)'; then
formats=$(echo "$formats" | tr ' ' '\n' | sed '/ami.*/d' | sed '/aws/d')
formats+=" ami ami_vmdk"
fi
# Keep compatibility with SDK scripts where "equinix_metal" remains unknown.
formats=$(echo "$formats" | tr ' ' '\n' | sed 's/equinix_metal/packet/g')
for format in ${formats}; do
echo " ################### VENDOR '${format}' ################### "
./run_sdk_container -n "${vms_container}" -C "${image_image}" \
-v "${vernum}" \