-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig.yaml
216 lines (190 loc) · 6.8 KB
/
config.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#-----------------------------------
# The start of the cicdstatemgr
# configuration file.
#-----------------------------------
cicdstatemgr:
#
# Datasources: required
#
# Here you can list one or more datasource
# of any of the available types as supported
# under the datasources sub-package.
#
# ONE of the datasources should be flagged
# as isPrimary=true to indicate it is authoritative
#
datasources:
#
# The redis datasource
#
# you can configure the AUTH username/password
# in a separate "secrets.yaml", with the same structure
redis:
host: localhost
port: 6379
isPrimary: true
#
# YAML file output
#
# path: if relative will be assumed relative from where
# the cicdstatemgr cmd's working directory when run
# Can also just be absolute
yamlfile:
path: localdata/cicdContextData.yaml
#
# JSON file output
#
# path: if relative will be assumed relative from where
# the cicdstatemgr cmd's working directory when run
# Can also just be absolute
jsonfile:
path: localdata/cicdContextData.json
#
# SHELL file output - a file that can be sourced to
# expose all data as ENV vars
#
# path: if relative will be assumed relative from where
# the cicdstatemgr cmd's working directory when run
# Can also just be absolute
shellfile:
path: localdata/cicdContextData.sh
# you can list out key names that will be excluded
# from shell VARIABLE generation completely
excludeKeyNames:
- jinja2Macros
- testGenerator1
#
# ID file output = only contains the cicdContextData ID
#
# path: if relative will be assumed relative from where
# the cicdstatemgr cmd's working directory when run
# Can also just be absolute
idfile:
path: localdata/cicdContextData.id
#
# This is the default baseline configuration for
# the 'trigger-pipeline' event handler which can
# be referenced in any individual app's pipeline-config.yaml
# under any:
# [pipelineName].event-handlers.[eventName].trigger-pipeline section
#
#
trigger:
# The URL all POSTs will be sent to
url: https://postman-echo.com/post
# Headers that will be automatically applied
# jinja2 references are valid here
headers:
- name: "test-header-1"
value: "{{secretData.someSuperSecret}}"
- name: "test-header-2"
value: "{{state.testHeader2Value}}"
- name: "random-header"
value: "{{random()}}"
# these argument are always sent in the payload that
# a 'trigger-pipeline' event handler sends in
# addition to ones that you can optionally configure
# in each individual event handler config in a pipeline
# config yaml file under its trigger-pipeline.args section
# the "trigger-pipeline.name" can be referenced here in the
# context variable "triggerPipeline"
auto-args:
autoArg1: "{{state.triggerAutoArg1}}"
randomId: "{{random()}}"
triggerPipelineName: "{{triggerPipeline.name}}"
#
# This is the default baseline configuration for
# the 'notify' event handler which can
# be referenced in any individual app's pipeline-config.yaml
# under any:
# [pipelineName].event-handlers.[eventName].notify section
#
#
notify:
#
# After a notify POST is sent to the endpoint the response
# body (unmarshalled from JSON) can be parsed via the
# 'auto-capture-response-data' config below based on one or
# more items below.
#
# Each array element below defines a individual instruction
# set for data to capture from the 'body'.
#
# from: jinja2 template that when parsed yields a string value
# to: sets the value yielded via the 'from:' to this target in the cicdContextData
# note the 'to' value can have jinja2 template syntax in it as well
#
auto-capture-response-data:
# the slack thread ID, only set if not previously set
- from: |
{%- if body.data -%}
{{- body.data.message -}}
{%- endif -%}
to: state.postedData.{{body.data.randomId}}.body.message
- from: |
{%- if body.headers -%}
{{- body.headers['user-agent'] -}}
{%- endif -%}
to: state.postedData.{{body.data.randomId}}.headers.userAgent
- from: |
{%- if body.data -%}
{{- body.data.randomId -}}
{%- endif -%}
to: state.lastPostedDataRandomId
#
# Configuration for the slack http client within cicdstatmgr
# used for the responder/notify/manual-choice handlers
# For this example we are just sending everything to postman echo
#
slack:
url: https://postman-echo.com/post
orgUrl: http://bitsofinfo.slack.com
#
# Configuration for the Tekton dashboard
#
dashboard:
pipelineRunUrl: http://localhost/#/namespaces/tekton-pipelines/pipelineruns
#
# Base templates used by the manual-choice and notify event handlers
#
templates:
# The notify handler constructs a context containing each handler invocations
# rendered message, target channel and the cicdContextData in the jinja2 context
# this will render the body to be POSTED to the notification endpoint
notify: >
{
"channel": "{{channel}}",
"message": "{{notify.message|json_dumps(stripLeadingTrailingQuotes=True)}}",
"randomId": "{{random()}}"
}
# The manual-choice handler constructs a context containing each handler invocations
# rendered manualChoice objects, target channel and the cicdContextData in the jinja2 context
# this will render the body to be POSTED to the notification endpoint
manual-choice: >
{
"channel": "{{channel}}",
"randomId": "{{random()}}",
"choices": [
{% for choiceName,choice in manualChoice.choices.items() %}
{
"header": "{{choice.header}}",
"options": [
{% for option in choice.options %}
{
"value": "{{option.value}}",
"text": "{{option.text}}"
} {{ "," if not loop.last }}
{% endfor %}
]
} {{ "," if not loop.last }}
{% endfor %}
]
}
# The respond handler constructs a context containing each handler invocations
# rendered message object, target channel and the cicdContextData in the jinja2 context
# this will render the body to be POSTED to the notification endpoint
respond: >
{
"response_text": "{{respond.message}}",
"someArbitraryKey":"{{respond.someArbitraryKey}}"
}