mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-03-22 14:56:38 -04:00
ci: fix download scripts for serial logs
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
9e9468ff44
commit
d3873988c9
.github/actions/constellation_create
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
# Usage: ./aws-logs.sh <region>
|
# Usage: ./aws-logs.sh <region>
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
|
echo "Using AWS region: ${1}"
|
||||||
|
|
||||||
|
pushd constellation-terraform
|
||||||
controlAutoscalingGroup=$(
|
controlAutoscalingGroup=$(
|
||||||
terraform show -json |
|
terraform show -json |
|
||||||
jq -r .'values.root_module.child_modules[] |
|
jq -r .'values.root_module.child_modules[] |
|
||||||
@ -14,6 +20,7 @@ workerAutoscalingGroup=$(
|
|||||||
select(.address == "module.instance_group_worker_nodes") |
|
select(.address == "module.instance_group_worker_nodes") |
|
||||||
.resources[0].values.name'
|
.resources[0].values.name'
|
||||||
)
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
controlInstances=$(
|
controlInstances=$(
|
||||||
aws autoscaling describe-auto-scaling-groups \
|
aws autoscaling describe-auto-scaling-groups \
|
||||||
|
52
.github/actions/constellation_create/gcp-logs.sh
vendored
52
.github/actions/constellation_create/gcp-logs.sh
vendored
@ -3,25 +3,49 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
shopt -s inherit_errexit
|
shopt -s inherit_errexit
|
||||||
|
|
||||||
controlInstanceGroup=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_control_plane") | .resources[0].values.base_instance_name')
|
pushd constellation-terraform
|
||||||
workerInstanceGroup=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_worker") | .resources[0].values.base_instance_name')
|
controlInstanceGroup=$(
|
||||||
zone=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_control_plane") | .resources[0].values.zone')
|
terraform show -json |
|
||||||
|
jq -r .'values.root_module.child_modules[] |
|
||||||
|
select(.address == "module.instance_group_control_plane") |
|
||||||
|
.resources[0].values.base_instance_name'
|
||||||
|
)
|
||||||
|
workerInstanceGroup=$(
|
||||||
|
terraform show -json |
|
||||||
|
jq -r .'values.root_module.child_modules[] |
|
||||||
|
select(.address == "module.instance_group_worker") |
|
||||||
|
.resources[0].values.base_instance_name'
|
||||||
|
)
|
||||||
|
zone=$(
|
||||||
|
terraform show -json |
|
||||||
|
jq -r .'values.root_module.child_modules[] |
|
||||||
|
select(.address == "module.instance_group_control_plane") |
|
||||||
|
.resources[0].values.zone'
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
controlInstanceGroup=${controlInstanceGroup##*/}
|
controlInstances=$(
|
||||||
workerInstanceGroupShort=${workerInstanceGroup##*/}
|
gcloud compute instance-groups managed list-instances "${controlInstanceGroup##*/}" \
|
||||||
|
--zone "${zone}" \
|
||||||
|
--format=json |
|
||||||
|
jq -r '.[] | .instance'
|
||||||
|
)
|
||||||
|
workerInstances=$(
|
||||||
|
gcloud compute instance-groups managed list-instances "${workerInstanceGroup##*/}" \
|
||||||
|
--zone "${zone}" \
|
||||||
|
--format=json |
|
||||||
|
jq -r '.[] | .instance'
|
||||||
|
)
|
||||||
|
|
||||||
controlInstances=$(gcloud compute instance-groups managed list-instances "${controlInstanceGroup}" --zone "${zone}" --format=json | jq -r '.[] | .instance')
|
allInstances="${controlInstances} ${workerInstances}"
|
||||||
workerInstances=$(gcloud compute instance-groups managed list-instances "${workerInstanceGroupShort}" --zone "${zone}" --format=json | jq -r '.[] | .instance')
|
|
||||||
|
|
||||||
ALL_INSTANCES="${controlInstances} ${workerInstances}"
|
|
||||||
|
|
||||||
printf "Fetching logs for %s and %s\n" "${controlInstances}" "${workerInstances}"
|
printf "Fetching logs for %s and %s\n" "${controlInstances}" "${workerInstances}"
|
||||||
|
|
||||||
for INSTANCE in ${ALL_INSTANCES}; do
|
for instance in ${allInstances}; do
|
||||||
SHORT_NAME=${INSTANCE##*/}
|
shortName=${instance##*/}
|
||||||
printf "Fetching for %s\n" "${SHORT_NAME}"
|
printf "Fetching for %s\n" "${shortName}"
|
||||||
gcloud compute instances get-serial-port-output "${INSTANCE}" \
|
gcloud compute instances get-serial-port-output "${instance}" \
|
||||||
--port 1 \
|
--port 1 \
|
||||||
--start 0 \
|
--start 0 \
|
||||||
--zone "${zone}" > "${SHORT_NAME}".log
|
--zone "${zone}" > "${shortName}".log
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user