-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (29 loc) · 814 Bytes
/
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
NAME=serverless-slack-bot
FUNCTION_NAME=bot
VERSION=latest
DATE=`date +"%Y%m%d_%H%M%S"`
TEST_JSON='{"name": "My Poll"}'
STEP_FUNCTION_JSON='{"name": "My Step Execution Poll"}'
STATE_MACHINE_ARN=
clean:
rm -rf dist
updateLambda: clean
mkdir -p dist
GOOS=linux GOARCH=amd64 go build -o dist/main main.go
cd dist && zip main.zip main
aws lambda update-function-code --function-name ${FUNCTION_NAME} --zip-file fileb://${pwd}dist/main.zip
invoke:
aws lambda invoke \
--function-name "${FUNCTION_NAME}" \
--log-type "Tail" \
--payload $(TEST_JSON) \
output/$(DATE).log \
| jq -r '.LogResult' | base64 -D
invokeStepFunctionExecution:
aws stepfunctions start-execution \
--state-machine-arn ${STATE_MACHINE_ARN} \
--input $(STEP_FUNCTION_JSON)
shell:
go run main.go shell
run:
go run main.go