-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
80 lines (75 loc) · 1.94 KB
/
serverless.yml
File metadata and controls
80 lines (75 loc) · 1.94 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
frameworkVersion: ">=1.28.0 <2.0.0"
plugins:
- serverless-step-functions
- serverless-pseudo-parameters
service: circleci-feedback
provider:
name: aws
runtime: go1.x
stage: dev
region: us-east-1
iamRoleStatements:
- Effect: 'Allow'
Action:
- 'kms:Decrypt'
Resource:
- "${env:KMS_KEY_ARN}"
- Effect: 'Allow'
Action:
- 'ssm:GetParameter'
Resource:
- "arn:aws:ssm:#{AWS::Region}:#{AWS::AccountId}:parameter/circleci-feedback/*"
- Effect: 'Allow'
Action:
- 'states:StartExecution'
Resource:
- "arn:aws:states:#{AWS::Region}:#{AWS::AccountId}:stateMachine:circleci-feedback"
package:
exclude:
- ./**
include:
- ./bin/**
functions:
entry:
handler: bin/entry
environment:
STEP_FUNCTION_ARN: "arn:aws:states:#{AWS::Region}:#{AWS::AccountId}:stateMachine:circleci-feedback"
events:
- http:
path: entry
method: post
findPipelineID:
handler: bin/find_pipeline_id
waitForJobs:
handler: bin/wait_for_jobs
stepFunctions:
stateMachines:
circleci-feedback:
name: circleci-feedback
definition:
Comment: "Step Function that Posts CircleCI Build Output on GitHub Pull Requests"
StartAt: findPipelineID
States:
findPipelineID:
Type: Task
Resource:
Fn::GetAtt: [findPipelineID, Arn]
Next: waitForJobs
waitForJobs:
Type: Task
Resource:
Fn::GetAtt: [waitForJobs, Arn]
Next: jobsDoneChoice
sleepForJobs:
Type: Wait
SecondsPath: "$.wait_for_jobs_wait_time"
Next: waitForJobs
jobsDoneChoice:
Type: Choice
Choices:
- Variable: "$.all_jobs_done"
BooleanEquals: true
Next: done
Default: sleepForJobs
done:
Type: Succeed