Skip to content

Commit

Permalink
fix(deploy-ecs): default to COMPLETE if rolloutState isn't present
Browse files Browse the repository at this point in the history
EC2 deploy status look like this:

```json
{
  "id": "ecs-svc/<id>",
  "status": "PRIMARY",
  "taskDefinition": "arn:aws:ecs:us-east-1:<account>:task-definition/<service>:<version>",
  "desiredCount": 1,
  "pendingCount": 0,
  "runningCount": 1,
  "failedTasks": 0,
  "createdAt": "2024-05-13T08:37:58.664000-04:00",
  "updatedAt": "2024-05-13T08:37:58.664000-04:00",
  "launchType": "EC2"
}
```

Since there's no `rolloutState` here, we default to `COMPLETED` and rely
on the `runningCount` equaling the `desiredCount`
  • Loading branch information
paulswartz committed May 13, 2024
1 parent 25cd076 commit 4476244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deploy-ecs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function check_deployment_complete() {
id="$(echo "${deployment_details}" | jq -r '.id')"

# get rollout state
rollout_status="$(echo "${deployment_details}" | jq -r '.rolloutState')"
rollout_status="$(echo "${deployment_details}" | jq -r '.rolloutState // "COMPLETED"')"

# get current task counts
desired_count="$(echo "${deployment_details}" | jq -r '[.desiredCount, 1] | max')"
Expand Down

0 comments on commit 4476244

Please sign in to comment.