initial commit

This commit is contained in:
Juan Canham
2020-03-17 03:54:15 +00:00
commit 83033b0cb6
35 changed files with 1554 additions and 0 deletions

18
deploy/shared-functions Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
SITENAME=$1
PROJECT=${SITENAME//./}
CFN_DIR="$( dirname "${BASH_SOURCE[0]}" )/cloudformation"
DEPLOY_CMD="aws cloudformation deploy --no-fail-on-empty-changeset --tags Classification=Public Site=$SITENAME"
deploy() {
# shellcheck disable=SC2145
echo "deploying $1 [${@:2}]"
# shellcheck disable=SC2068
$DEPLOY_CMD --stack-name "${PROJECT}-$1" --template-file "${CFN_DIR}/$1.yaml" --parameter-overrides ${@:2}
aws cloudformation wait stack-exists --stack-name "${PROJECT}-$1"
}
get-output() {
aws cloudformation describe-stacks --stack-name "${PROJECT}-$1" --query "Stacks[0].Outputs[?OutputKey==\`$2\`].OutputValue" --output text
}