mirror of
				https://github.com/edgelesssys/constellation.git
				synced 2025-10-31 11:49:02 -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
					
				
					 2 changed files with 45 additions and 14 deletions
				
			
		|  | @ -2,6 +2,12 @@ | |||
| 
 | ||||
| # Usage: ./aws-logs.sh <region> | ||||
| 
 | ||||
| set -euo pipefail | ||||
| shopt -s inherit_errexit | ||||
| 
 | ||||
| echo "Using AWS region: ${1}" | ||||
| 
 | ||||
| pushd constellation-terraform | ||||
| controlAutoscalingGroup=$( | ||||
|   terraform show -json | | ||||
|     jq -r .'values.root_module.child_modules[] | | ||||
|  | @ -14,6 +20,7 @@ workerAutoscalingGroup=$( | |||
|         select(.address == "module.instance_group_worker_nodes") | | ||||
|         .resources[0].values.name' | ||||
| ) | ||||
| popd | ||||
| 
 | ||||
| controlInstances=$( | ||||
|   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 | ||||
| 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') | ||||
| 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') | ||||
| pushd constellation-terraform | ||||
| controlInstanceGroup=$( | ||||
|   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##*/} | ||||
| workerInstanceGroupShort=${workerInstanceGroup##*/} | ||||
| controlInstances=$( | ||||
|   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') | ||||
| workerInstances=$(gcloud compute instance-groups managed list-instances "${workerInstanceGroupShort}" --zone "${zone}" --format=json | jq -r '.[] | .instance') | ||||
| 
 | ||||
| ALL_INSTANCES="${controlInstances} ${workerInstances}" | ||||
| allInstances="${controlInstances} ${workerInstances}" | ||||
| 
 | ||||
| printf "Fetching logs for %s and %s\n" "${controlInstances}" "${workerInstances}" | ||||
| 
 | ||||
| for INSTANCE in ${ALL_INSTANCES}; do | ||||
|   SHORT_NAME=${INSTANCE##*/} | ||||
|   printf "Fetching for %s\n" "${SHORT_NAME}" | ||||
|   gcloud compute instances get-serial-port-output "${INSTANCE}" \ | ||||
| for instance in ${allInstances}; do | ||||
|   shortName=${instance##*/} | ||||
|   printf "Fetching for %s\n" "${shortName}" | ||||
|   gcloud compute instances get-serial-port-output "${instance}" \ | ||||
|     --port 1 \ | ||||
|     --start 0 \ | ||||
|     --zone "${zone}" > "${SHORT_NAME}".log | ||||
|     --zone "${zone}" > "${shortName}".log | ||||
| done | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Paul Meyer
						Paul Meyer