-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakefile
48 lines (39 loc) · 1.67 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
36
37
38
39
40
41
42
43
44
45
46
47
48
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
run:
docker run -p 8083:8083 \
--mount type=bind,readonly,source=$(ROOT_DIR)/state-machine/test/MockConfigFile.json,destination=/home/StepFunctionsLocal/MockConfigFile.json \
-e SFN_MOCK_CONFIG="/home/StepFunctionsLocal/MockConfigFile.json" \
amazon/aws-stepfunctions-local
create:
aws stepfunctions create-state-machine \
--endpoint-url http://localhost:8083 \
--definition file://state-machine/state-machine.asl.json \
--name "LocalTesting" \
--role-arn "arn:aws:iam::123456789012:role/DummyRole" \
--no-cli-pager
happy:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name HappyPathTest \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#HappyPathTest \
--no-cli-pager
fileNotFound:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name FileNotFoundTest \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#FileNotFoundTest \
--no-cli-pager
all: create happy fileNotFound
happy-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:HappyPathTest \
--query 'events[?type==`ExecutionSucceeded`]' \
--no-cli-pager
fileNotFound-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:FileNotFoundTest \
--query 'events[?type==`ExecutionFailed` && executionFailedEventDetails.error==`S3.NoSuchBucketException`]' \
--no-cli-pager
history: happy-h fileNotFound-h