From 661282151e5674eb09f7cf3919cf6d013a22e139 Mon Sep 17 00:00:00 2001 From: Leandro Salgado Date: Wed, 8 Apr 2026 14:58:27 +0100 Subject: [PATCH 1/3] infra: parallelize deployment scale-ups --- src/jobs/helm_aws.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/jobs/helm_aws.yml b/src/jobs/helm_aws.yml index a47d8f13..8ac66a87 100644 --- a/src/jobs/helm_aws.yml +++ b/src/jobs/helm_aws.yml @@ -118,6 +118,7 @@ steps: cmd_name: Reset the replica count of each deployment for the specified env deploy: false cmd: | + declare -a error_deployments if ! [[ -z "<< parameters.scale_down_time_limit >>" ]]; then current_timestamp=$(date +%s) time_limit_timestamp=$(date -d "<< parameters.scale_down_time_limit >>" +%s) @@ -135,6 +136,7 @@ steps: for RELEASE in $RELEASES ; do DEPLOYMENTS=$(helm get manifest -n $NAMESPACE $RELEASE | yq eval -o json | jq -r '. | select(.kind == "Deployment") | .metadata.name' | sort -r) for DEPLOYMENT in $DEPLOYMENTS ; do + hasErrors=false if [ << parameters.scale_environment_down >> = true ]; then REPLICA_COUNT=0 else @@ -142,8 +144,14 @@ steps: fi kubectl scale --replicas=$REPLICA_COUNT deployment/$DEPLOYMENT -n $NAMESPACE if [[ << parameters.wait_for_pods_ready >> = true ]]; then - kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >> + kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >> || hasErrors=true + if [[ hasErrors = true ]]; then + error_deployments+=("$DEPLOYMENT") + fi fi done + if [[ ${#error_deployments[@]} != 0 ]]; then + echo "The following deployments failed to be scaled up: " + ${files[*]} + exit 1 done fi From 4634e2b8198096d4e88143c1ecb937943761861a Mon Sep 17 00:00:00 2001 From: Leandro Salgado Date: Wed, 8 Apr 2026 15:25:23 +0100 Subject: [PATCH 2/3] infra: parallelize deployment scale-ups --- src/jobs/helm_aws.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobs/helm_aws.yml b/src/jobs/helm_aws.yml index 8ac66a87..9119819e 100644 --- a/src/jobs/helm_aws.yml +++ b/src/jobs/helm_aws.yml @@ -151,7 +151,7 @@ steps: fi done if [[ ${#error_deployments[@]} != 0 ]]; then - echo "The following deployments failed to be scaled up: " + ${files[*]} + echo "The following deployments failed to be scaled up: " + ${files[*]} exit 1 done fi From f45ac575d71b6329116fe119fcc2841e46202078 Mon Sep 17 00:00:00 2001 From: Leandro Salgado Date: Thu, 9 Apr 2026 12:22:33 +0100 Subject: [PATCH 3/3] cleanup --- src/jobs/helm_aws.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/jobs/helm_aws.yml b/src/jobs/helm_aws.yml index 9119819e..d850e5fc 100644 --- a/src/jobs/helm_aws.yml +++ b/src/jobs/helm_aws.yml @@ -136,7 +136,6 @@ steps: for RELEASE in $RELEASES ; do DEPLOYMENTS=$(helm get manifest -n $NAMESPACE $RELEASE | yq eval -o json | jq -r '. | select(.kind == "Deployment") | .metadata.name' | sort -r) for DEPLOYMENT in $DEPLOYMENTS ; do - hasErrors=false if [ << parameters.scale_environment_down >> = true ]; then REPLICA_COUNT=0 else @@ -144,14 +143,12 @@ steps: fi kubectl scale --replicas=$REPLICA_COUNT deployment/$DEPLOYMENT -n $NAMESPACE if [[ << parameters.wait_for_pods_ready >> = true ]]; then - kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >> || hasErrors=true - if [[ hasErrors = true ]]; then - error_deployments+=("$DEPLOYMENT") - fi + kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >> || error_deployments+=("$DEPLOYMENT") fi done - if [[ ${#error_deployments[@]} != 0 ]]; then - echo "The following deployments failed to be scaled up: " + ${files[*]} - exit 1 done + if [[ ${#error_deployments[@]} != 0 ]]; then + echo "The following deployments failed to be scaled up:" ${error_deployments[*]} + exit 1 + fi fi