|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: argocd-notifications-cm |
| 5 | +data: |
| 6 | + trigger.sync-operation-failed: | |
| 7 | + when: app.status.operationState.phase in ['Error', 'Failed'] |
| 8 | + send: [sync-operation-status-change] |
| 9 | + trigger.sync-operation-succeeded: | |
| 10 | + when: app.status.operationState.phase in ['Succeeded'] |
| 11 | + send: [sync-operation-status-change] |
| 12 | + trigger.sync-operation-running: | |
| 13 | + when: app.status.operationState.phase in ['Running'] |
| 14 | + send: [sync-operation-status-change] |
| 15 | + trigger.out-of-sync: | |
| 16 | + when: app.status.sync.status == 'OutOfSync' |
| 17 | + send: [out-of-sync] |
| 18 | + trigger.build-failed: | |
| 19 | + when: app.status.sync.status == 'Unknown' and app.status.sync.revision != nil |
| 20 | + send: [build-failed] |
| 21 | + trigger.app-unhealthy: | |
| 22 | + when: app.status.health.status == 'Degraded' |
| 23 | + send: [app-unhealthy] |
| 24 | +
|
| 25 | + template.sync-operation-status-change: | |
| 26 | + webhook: |
| 27 | + bitbot: |
| 28 | + method: POST |
| 29 | + body: "Sync for application \x0315{{.app.metadata.name}}\x03 (\x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03) {{ |
| 30 | + if eq .app.status.operationState.phase \"Running\" }}is \x0307running\x03{{end}}{{ |
| 31 | + if eq .app.status.operationState.phase \"Succeeded\"}}has \x0303succeeded\x03: {{.app.status.operationState.message}}{{end}}{{ |
| 32 | + if eq .app.status.operationState.phase \"Error\" }}has \x0304errored\x03: {{.app.status.operationState.message}}{{end}}{{ |
| 33 | + if eq .app.status.operationState.phase \"Failed\" }}has \x0304failed\x03: {{.app.status.operationState.message}}{{end |
| 34 | + }} {{ if ne .app.status.operationState.phase \"Succeeded\" }}(blame \x0315{{.app.status.operationState.operation.initiatedBy.username}}\x03){{end}}" |
| 35 | + template.app-unhealthy: | |
| 36 | + webhook: |
| 37 | + bitbot: |
| 38 | + method: POST |
| 39 | + body: "Application {{.app.metadata.name}} has \x0304degraded\x03 (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)" |
| 40 | + template.out-of-sync: | |
| 41 | + webhook: |
| 42 | + bitbot: |
| 43 | + method: POST |
| 44 | + body: "Application {{.app.metadata.name}} is out of sync (Targeting: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)" |
| 45 | + template.build-failed: | |
| 46 | + webhook: |
| 47 | + bitbot: |
| 48 | + method: POST |
| 49 | + body: "Unable to build {{.app.metadata.name}} (Commit: \x0313{{printf \"%.7s\" .app.status.sync.revision}}\x03)" |
0 commit comments