#!/bin/bash set -e source $utilsLocation/onStart.sh source $utilsLocation/getLatestRockyDiskPath.sh currentDir=$(pwd) tempDiskVM="$currentDir/local.qcow2" if [ ! -f $tempDiskVM ]; then echo "Copying $latestRockyDiskPath into $tempDiskVM" cp $latestRockyDiskPath $tempDiskVM else echo "!!! ERROR $tempDiskVM - already exists !!!" exit 1 fi imagePath=$tempDiskVM echo "--- Using image: $imagePath ---" echo "--- Creating Rocky Cloud image KVM ---" virt-install --name=rocky --ram=4096 --vcpus=8 \ --disk $imagePath \ --boot hd --noautoconsole \ --os-variant rhel9.0 echo "--- Finished creating Rocky Cloud image KVM ---" echo "--- Getting the Rocky Cloud image KVM's IP ---" source $utilsLocation/setVMIP.sh # Done here, and not through virt-customize due to it making the end image several hundred magabytes bigger outputImageNameWithOrg="$CONTAINER_REGISTRY_ORG/$OUTPUT_BOOTC_IMAGE_NAME" latestImageNameWithOrg="$CONTAINER_REGISTRY_ORG/$OUTPUT_BOOTC_IMAGE_NAME_LATEST" echo "--- Starting Build-Push for $outputImageNameWithOrg ---" gitDelimiter="&&" if [ "$CI" != "true" ]; then gitDelimiter=";" # Soft fail git clone if running this locally fi resizeLog=$(ssh -o ConnectTimeout=300 -o StrictHostKeyChecking=no rocky@$vmIPaddress <