Skip to content

Commit a85e367

Browse files
Fix check for running deployments script (#3584)
- Strange behaviour caused output to be None\nNone in some cases and simply None in others. Refactoring to not get null as query output fixes the issue
2 parents a1209d4 + 5634688 commit a85e367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

terraform/scripts/check-for-running-deployments.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ echo "Deployment Group Name: $APPLICATION_GROUP"
1515

1616
running_deployment=$(aws deploy list-deployments --application-name $APPLICATION_NAME \
1717
--deployment-group-name $APPLICATION_GROUP --include-only-statuses InProgress \
18-
--query 'deployments[0]' --output text) || { echo "No running deployment found for ${environment}"; exit 0; }
19-
if [ "$running_deployment" != "None" ]; then
18+
--query 'deployments[]' --output text) || { echo "No running deployment found for ${environment}"; exit 0; }
19+
if [ -n "$running_deployment" ]; then
2020
echo "A mavis deployment for ${environment} is currently running: $running_deployment"
2121
echo "Aborting infrastructure deployment"
2222
exit 1

0 commit comments

Comments
 (0)