Skip to content

Commit 4616a12

Browse files
Merge pull request #243 from codacy/ls/paralelize-deployment-scale-ups
infra: parallelize deployment scale-ups
2 parents 2b506b7 + f45ac57 commit 4616a12

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/jobs/helm_aws.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ steps:
118118
cmd_name: Reset the replica count of each deployment for the specified env
119119
deploy: false
120120
cmd: |
121+
declare -a error_deployments
121122
if ! [[ -z "<< parameters.scale_down_time_limit >>" ]]; then
122123
current_timestamp=$(date +%s)
123124
time_limit_timestamp=$(date -d "<< parameters.scale_down_time_limit >>" +%s)
@@ -142,8 +143,12 @@ steps:
142143
fi
143144
kubectl scale --replicas=$REPLICA_COUNT deployment/$DEPLOYMENT -n $NAMESPACE
144145
if [[ << parameters.wait_for_pods_ready >> = true ]]; then
145-
kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >>
146+
kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout << parameters.wait_for_pods_ready_timeout >> || error_deployments+=("$DEPLOYMENT")
146147
fi
147148
done
148149
done
150+
if [[ ${#error_deployments[@]} != 0 ]]; then
151+
echo "The following deployments failed to be scaled up:" ${error_deployments[*]}
152+
exit 1
153+
fi
149154
fi

0 commit comments

Comments
 (0)