File ec2-upload of Package test-image-aws-isolated-compute

#!/bin/bash
# shellcheck shell=bash

set -ex

if [ ! -d binaries ];then
    echo "run osc getbinaries first..."
    exit 1
fi

image=$(echo binaries/*.raw.xz)
arch=$(echo "${image}" | cut -f2 -d. | cut -f1 -d-)
desc="$(basename "${image}" | cut -f1 -d.)"-"${arch}"
name="${desc}-v$(date +%Y%m%d)"

ec2arch="${arch}"
if [ "${arch}" == "aarch64" ];then
    ec2arch=arm64
fi

ec2uploadimg \
    --wait-count 5 \
    -a suse-pct \
    -f ~/.ec2/ec2utils.conf \
    -m "${ec2arch}" \
    -n "${name}" \
    --sriov-support \
    --ena-support \
    --boot-mode uefi \
    -r eu-central-1 \
    --description "${desc}" \
    --verbose \
    --tpm-support v2.0 \
    -B ssd \
"${image}"
openSUSE Build Service is sponsored by