-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·32 lines (24 loc) · 823 Bytes
/
deploy.sh
File metadata and controls
executable file
·32 lines (24 loc) · 823 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
set -e
STACK_NAME=cfn-bot
S3_BUCKET=$(aws s3 ls | awk '/sam-deployments/{print $NF}')
if [[ -z $S3_BUCKET ]]; then
S3_BUCKET=sam-deployments-$RANDOM$RANDOM
aws s3 mb s3://$S3_BUCKET
fi
# load twitter keys
. ./.twitter_keys
# load mastodon keys
. ./.mastodon_keys
make build SERVICE=cfnbot
sam package --template-file template.yaml \
--output-template-file serverless-output.yaml \
--s3-bucket $S3_BUCKET
sam deploy --region us-east-1 \
--template-file serverless-output.yaml \
--stack-name $STACK_NAME \
--capabilities CAPABILITY_IAM \
--parameter-overrides "TwitterAccessTokenKey=$TWITTER_ACCESS_TOKEN_KEY" \
"TwitterAccessTokenSecret=$TWITTER_ACCESS_TOKEN_SECRET" \
"MastodonAccessToken=$MASTODON_ACCESS_TOKEN" \
"MastodonApiBaseUrl=$MASTODON_API_BASE_URL"