Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
refs smithmicro#53: Gracefully exit lucy run when ecs-cli up fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcello Testi committed Sep 1, 2020
1 parent 00ad8a0 commit 23d362b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lucy/lucy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ else
echo "Creating cluster/$CLUSTER_NAME"
ecs-cli up --cluster $CLUSTER_NAME --size $INSTANCE_COUNT --capability-iam --instance-type $INSTANCE_TYPE --keypair $KEY_NAME \
--security-group $SECURITY_GROUP --vpc $VPC_ID --subnets $SUBNET_ID --force --verbose
CHECKUP=$?
if [ ! $CHECKUP -eq 0 ]
then
echo "Cluster/instances creation command wasn't successful. See above for details."
FINDCLUSTER=$(aws ecs list-clusters --query "clusterArns[?ends_with(@, 'cluster/JMeter')]" --output text)
if [ ! -z "$FINDCLUSTER" -a -z "$RETAIN_CLUSTER" ]
then
echo "Deleting cluster/$CLUSTER_NAME"
ecs-cli down --cluster $CLUSTER_NAME --force
fi
exit $CHECKUP
fi
fi

# Step 2 - Wait for the cluster to have all container instances registered
Expand Down

0 comments on commit 23d362b

Please sign in to comment.