Skip to content

Commit

Permalink
Merge pull request #38 from envato/always-output-events
Browse files Browse the repository at this point in the history
 Output service events when deploy fails
  • Loading branch information
Patrick Robinson authored Jul 11, 2019
2 parents a25cd93 + 38d8713 commit a28cabb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,22 @@ aws ecs update-service \

## Now we wait till it's stable
echo "--- :ecs: Waiting for services to stabilize"
deploy_exitcode=0
aws ecs wait services-stable \
--cluster "${cluster}" \
--services "${service_name}"
--services "${service_name}" || deploy_exitcode=$?

aws ecs describe-services \
--cluster "${cluster}" \
--service "${service_name}"

echo "+++ :ecs: Service is up 🚀"
service_events=$(aws ecs describe-services \
--cluster "${cluster}" \
--service "${service_name}" \
--query 'services[].events' --output text)

if [[ $deploy_exitcode -eq 0 ]]; then
echo "--- :ecs: Service is up 🚀"
echo "$service_events"
else
echo "+++ :ecs: Service failed to deploy ❌"
echo "$service_events"
exit $deploy_exitcode
fi

0 comments on commit a28cabb

Please sign in to comment.