constellation/.github/actions/constellation_create/gcp-logs.sh
Moritz Sanft 43076e96a6
ci: fix resource selection for serial log downloading (#2101)
Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com>
Co-authored-by: Otto Bittner <cobittner@posteo.net>
2023-07-13 16:28:33 +02:00

22 lines
490 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit
echo "Using Zone: ${1}"
echo "Using Constellation UID: ${2}"
allInstances=$(
gcloud compute instances list \
--filter="labels.constellation-uid=${2}" \
--format=json | yq eval '.[] | .name' -
)
for instance in ${allInstances}; do
printf "Fetching for %s\n" "${instance}"
gcloud compute instances get-serial-port-output "${instance}" \
--port 1 \
--start 0 \
--zone "${1}" > "${instance}".log
done