-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathargocd-notifications-cm.patch.yaml
More file actions
66 lines (61 loc) · 2.76 KB
/
argocd-notifications-cm.patch.yaml
File metadata and controls
66 lines (61 loc) · 2.76 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
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
trigger.sync-operation-failed: |
- when: app.status.operationState.phase in ['Error', 'Failed']
send: [sync-operation-status-change]
trigger.sync-operation-succeeded: |
- when: app.status.operationState.phase in ['Succeeded']
send: [sync-operation-status-change]
trigger.sync-operation-running: |
- when: app.status.operationState.phase in ['Running']
send: [sync-operation-status-change]
trigger.out-of-sync: |
- when: app.status.sync.status == 'OutOfSync'
send: [out-of-sync]
trigger.build-failed: |
- when: app.status.sync.status == 'Unknown' and app.status.sync.revision != nil
send: [build-failed]
trigger.app-unhealthy: |
- when: app.status.health.status == 'Degraded'
send: [app-unhealthy]
template.sync-operation-status-change: |
webhook:
bitbot:
method: POST
body: "Sync for application \x0315{{.app.metadata.name}}\x03 (\x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03) {{
if eq .app.status.operationState.phase \"Running\" }}is \x0307running\x03{{end}}{{
if eq .app.status.operationState.phase \"Succeeded\"}}has \x0303succeeded\x03: {{.app.status.operationState.message}}{{end}}{{
if eq .app.status.operationState.phase \"Error\" }}has \x0304errored\x03: {{.app.status.operationState.message}}{{end}}{{
if eq .app.status.operationState.phase \"Failed\" }}has \x0304failed\x03: {{.app.status.operationState.message}}{{end
}} {{ if ne .app.status.operationState.phase \"Succeeded\" }}(blame \x0315{{.app.status.operationState.operation.initiatedBy.username}}\x03){{end}}"
github:
repoURLPath: "{{.app.spec.source.repoURL}}"
revisionPath: "{{.app.status.operationState.syncResult.revision}}"
status:
state: success
label: "continuous-delivery/{{.app.metadata.name}}"
targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
template.app-unhealthy: |
webhook:
bitbot:
method: POST
body: "Application {{.app.metadata.name}} has \x0304degraded\x03 (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
template.out-of-sync: |
webhook:
bitbot:
method: POST
body: "Application {{.app.metadata.name}} is out of sync (Targeting: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
template.build-failed: |
webhook:
bitbot:
method: POST
body: "Unable to build {{.app.metadata.name}} (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)"
service.github: |
appID: 67056
installationID: 9726893
privateKey: $github-privateKey
service.webhook.bitbot: |
url: $bitbot-url