-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
31 lines (25 loc) · 816 Bytes
/
Copy pathdeploy.sh
File metadata and controls
31 lines (25 loc) · 816 Bytes
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
31
#!/bin/bash
# dev: ./deploy.sh
# test: ./deploy.sh test
# stg: ./deploy.sh stg
# prod: ./deploy.sh prod
STAGE=${1:-dev}
PROJECT=sam-tutorial-$STAGE
# Change the suffix on the bucket to something unique!
BUCKET=$PROJECT-rema
# make a build directory to store artifacts
rm -rf build
mkdir build
npx tsc
# make the deployment bucket in case it doesn't exist
aws s3 mb s3://$BUCKET
# generate next stage yaml file
aws cloudformation package \
--template-file template.yml \
--output-template-file build/output.yml \
--s3-bucket $BUCKET
# the actual deployment step
aws cloudformation deploy \
--template-file build/output.yml \
--stack-name $PROJECT \
--capabilities CAPABILITY_IAM