Files
sos_testing/get_image_names.sh
2024-10-30 21:22:30 +00:00

29 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Grab bionic image name
bionic_json=$(gcloud compute images list --project ubuntu-os-cloud --filter="family:ubuntu-1804-lts" --show-deprecated --format=json)
bionic_image=$(echo ${bionic_json} | jq -rc '.[] | select(.architecture == "X86_64") | .name' | sort | tail -n 1)
echo ${bionic_image}
# Grab IDs for the other images
families="ubuntu-2004-lts ubuntu-2204-lts ubuntu-2404-lts-amd64"
for family in ${families}
do
distro_json=$(gcloud compute images list --project ubuntu-os-cloud --filter="family:${family}" --format=json)
distro_image=$(echo ${distro_json} | jq -rc '.[] | select(.architecture == "X86_64") | .name')
echo $distro_image
done
latest_sup_rev="2410"
gcloud compute images list --project ubuntu-os-cloud --filter="family:ubuntu-${latest_sup_rev}-amd64"
gcloud compute images list --project ubuntu-os-cloud --filter="family:ubuntu-minimal-${latest_sup_rev}-amd64"
# For testing for the next daily release depdning on LTS or non-LTS
gcloud compute images list --project ubuntu-os-cloud-devel --filter="family:ubuntu-2504-amd64"
gcloud compute images list --project ubuntu-os-cloud-devel --filter="family:ubuntu-2404-lts-amd64"