-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·30 lines (24 loc) · 1.13 KB
/
deploy.sh
File metadata and controls
executable file
·30 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# provide lambda bucket as env variable or script argument
LAMBDA_BUCKET="${LAMBDA_BUCKET:-${1:-}}"
STACK_NAME="java-starter"
if [[ "${LAMBDA_BUCKET}" == "" || "${STACK_NAME}" == "" ]]; then
echo "You must set LAMBDA_BUCKET and STACK_NAME first."
echo "LAMBDA_BUCKET must point to an S3 bucket and will be used for uploading the Lambda function artifacts."
exit 1;
fi
mvn verify install -DskipTests
aws cloudformation package --template-file cfn.yml --s3-bucket "${LAMBDA_BUCKET}" --output-template-file cfn.packaged.yml
aws cloudformation deploy --template-file cfn.packaged.yml --stack-name "${STACK_NAME}" --capabilities CAPABILITY_IAM
aws cloudformation describe-stacks \
--stack-name ${STACK_NAME} \
--query "Stacks[0].Outputs[?OutputKey == 'TestUrlOne'].OutputValue" \
--output text
aws cloudformation describe-stacks \
--stack-name ${STACK_NAME} \
--query "Stacks[0].Outputs[?OutputKey == 'TestUrlTwo'].OutputValue" \
--output text
aws cloudformation describe-stacks \
--stack-name ${STACK_NAME} \
--query "Stacks[0].Outputs[?OutputKey == 'TestEvent'].OutputValue" \
--output text