-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-to-s3.sh
executable file
·27 lines (22 loc) · 1.05 KB
/
deploy-to-s3.sh
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
rm -f ./packaged-template.yaml
cp package.json src/package.json
cp yarn.lock src/yarn.lock
cd src
yarn install --production --frozen-lockfile
cd ..
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
# us-east-1
aws cloudformation package \
--template-file ./sam-template.yaml \
--s3-bucket sammarks-cf-templates \
--output-template-file packaged-template.yaml
aws s3 cp ./packaged-template.yaml "s3://sammarks-cf-templates/scheduled-tasks/$PACKAGE_VERSION/template.yaml"
aws s3 cp ./packaged-template.yaml "s3://sammarks-cf-templates/scheduled-tasks/template.yaml"
# us-east-2
aws cloudformation package \
--template-file ./sam-template.yaml \
--s3-bucket sammarks-cf-templates-us-east-2 \
--output-template-file packaged-template.yaml
aws s3 cp ./packaged-template.yaml "s3://sammarks-cf-templates-us-east-2/scheduled-tasks/$PACKAGE_VERSION/template.yaml"
aws s3 cp ./packaged-template.yaml "s3://sammarks-cf-templates-us-east-2/scheduled-tasks/template.yaml"
rm -rf ./src/node_modules ./src/package.json ./src/yarn.lock ./packaged-template.yaml