-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timeout option #33
Comments
I need this too 😄 |
@amazingguni how long of a timeout do you need? |
In my case, it should be more than 15 minutes. echo "Verifying that << parameters.task-definition-arn >> is deployed.."
attempt=0
while [ "$attempt" -lt << parameters.max-poll-attempts >> ]
do
DEPLOYMENTS=$(aws ecs describe-services \
--cluster << parameters.cluster-name >> \
--services ${SERVICE_NAME} \
--output text \
--query 'services[0].deployments[].[taskDefinition, status]')
NUM_DEPLOYMENTS=$(aws ecs describe-services \
--cluster << parameters.cluster-name >> \
--services ${SERVICE_NAME} \
--output text \
--query 'length(services[0].deployments)')
TARGET_REVISION=$(aws ecs describe-services \
--cluster << parameters.cluster-name >> \
--services ${SERVICE_NAME} \
--output text \
--query "services[0].deployments[?taskDefinition==\`<< parameters.task-definition-arn >>\` && runningCount == desiredCount && (status == \`PRIMARY\` || status == \`ACTIVE\`)][taskDefinition]")
echo "Current deployments: $DEPLOYMENTS"
if [ "$NUM_DEPLOYMENTS" = "1" ] && [ "$TARGET_REVISION" = "<< parameters.task-definition-arn >>" ]; then
echo "The task definition revision $TARGET_REVISION is the only deployment for the service and has attained the desired running task count."
exit 0
else
echo "Waiting for revision << parameters.task-definition-arn >> to reach desired running count / older revisions to be stopped.."
sleep << parameters.poll-interval >>
fi
attempt=$((attempt + 1))
done
echo "Stopped waiting for deployment to be stable - please check the status of << parameters.task-definition-arn >> on the AWS ECS console." |
@amazingguni Yep makes sense to have a configurable timeout, and probably also to raise the default timeout :) |
…to complete Fixes #33
wait-for-services-stable currently only waits 10 minutes, which might not be long enough for all deployments
The text was updated successfully, but these errors were encountered: