-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless-stepf.yml
45 lines (45 loc) · 1.31 KB
/
serverless-stepf.yml
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
rBuilds:
id: RBuildsStepFunction
name: r-builds-${self:provider.stage}
definition:
StartAt: QueueBuilds
States:
QueueBuilds:
Type: Task
Resource:
Fn::Sub: arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service}-${self:provider.stage}-queueBuilds
Next: Wait
Wait:
Type: Wait
Seconds: 60
Next: JobQueueStatus
JobQueueStatus:
Type: Task
Resource:
Fn::Sub: arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service}-${self:provider.stage}-jobQueueStatus
Next: QueueEmpty?
QueueEmpty?:
Type: Choice
Choices:
- Variable: "$.unfinishedJobCount"
NumericGreaterThan: 0
Next: Wait
- Variable: "$.unfinishedJobCount"
NumericEquals: 0
Next: Finished
Finished:
Type: Task
Resource:
Fn::Sub: arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${self:service}-${self:provider.stage}-finished
Next: SuccessOrFail
SuccessOrFail:
Type: Choice
Choices:
- Variable: "$.failedJobCount"
NumericGreaterThan: 0
Next: Fail
Default: Succeed
Fail:
Type: Fail
Succeed:
Type: Succeed