-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (31 loc) · 1.21 KB
/
Makefile
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
32
33
34
35
include .env
token:
go run cmd/get-token/main.go
update:
env GOOS=linux go build ./cmd/sync-discover
zip sync-discover.zip ./sync-discover
aws lambda update-function-code \
--region us-east-1 \
--function-name sync-discover \
--zip-file fileb://sync-discover.zip
rm -f sync-discover sync-discover.zip
update-env:
export `cat .env | xargs`
aws lambda update-function-configuration \
--region us-east-1 \
--function-name sync-discover \
--environment Variables="{SPOTIFY_ID=${SPOTIFY_ID},SPOTIFY_SECRET=${SPOTIFY_SECRET},TARGET_PLAYLIST=${TARGET_PLAYLIST},BUCKET=${BUCKET},TOKEN_FILE=${TOKEN_FILE},REGION=${REGION}}"
upload:
export `cat .env | xargs`
env GOOS=linux go build ./cmd/sync-discover
zip sync-discover.zip ./sync-discover
aws lambda create-function \
--region us-east-1 \
--function-name sync-discover \
--memory 128 \
--role arn:aws:iam::526123814436:role/lambda_execution \
--runtime go1.x \
--zip-file fileb://sync-discover.zip \
--handler sync-discover \
--environment Variables="{SPOTIFY_ID=${SPOTIFY_ID},SPOTIFY_SECRET=${SPOTIFY_SECRET},TARGET_PLAYLIST=${TARGET_PLAYLIST},BUCKET=${BUCKET},TOKEN_FILE=${TOKEN_FILE},REGION=${REGION}}"
rm -f sync-discover sync-discover.zip