Skip to content

Commit 3889d6d

Browse files
author
Patrick Robinson
committed
Output service events when deploy fails
1 parent 827b090 commit 3889d6d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

β€Žhooks/commandβ€Ž

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,21 @@ aws ecs update-service \
9898

9999
## Now we wait till it's stable
100100
echo "--- :ecs: Waiting for services to stabilize"
101+
deploy_exitcode=0
101102
aws ecs wait services-stable \
102103
--cluster "${cluster}" \
103-
--services "${service_name}"
104+
--services "${service_name}" || deploy_exitcode=$?
104105

105-
aws ecs describe-services \
106-
--cluster "${cluster}" \
107-
--service "${service_name}"
108106

109-
echo "+++ :ecs: Service is up πŸš€"
107+
services_events=$(aws ecs describe-services \
108+
--cluster "${cluster}" \
109+
--service "${service_name}")
110+
111+
if [[ $deploy_exitcode -eq 0 ]]; then
112+
echo "--- :ecs: Service is up πŸš€"
113+
echo $service_events
114+
else
115+
echo "+++ :ecs: Service failed to deploy ❌"
116+
echo $service_events
117+
exit $deploy_exitcode
118+
fi

0 commit comments

Comments
Β (0)