|
@@ -1,11 +1,23 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
+set -e
|
|
|
+
|
|
|
source bash-config.cfg
|
|
|
|
|
|
ACCOUNT_ID=$(aws sts get-caller-identity --profile $CLI_PROFILE --query Account --output text)
|
|
|
|
|
|
NEW_STACK_NAME="${STACK_NAME}-${ACCOUNT_ID}"
|
|
|
|
|
|
+if [ $ACCOUNT_ID == None ]; then
|
|
|
+ echo "Couldn't find Account ID, please check if AWS Profile $CLI_PROFILE is set"
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+if [ ! -f "$KEY_PATH" ]; then
|
|
|
+ echo "Key file not found at $KEY_PATH"
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
# Deploy the CloudFormation template
|
|
|
echo -e "\n\n=========== Deploying main.yml ==========="
|
|
|
aws cloudformation deploy \
|