28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: argocd-notifications-cm
|
|
namespace: argocd
|
|
data:
|
|
service.webhook.gitea: |
|
|
url: http://gitea-ha-http.apps:3000
|
|
headers:
|
|
- name: Authorization
|
|
value: token $GITEA_TOKEN
|
|
- name: Content-Type
|
|
value: application/json
|
|
template.gitea-create-issue: |
|
|
webhook:
|
|
gitea:
|
|
method: POST
|
|
path: /api/v1/repos/olb42/k8s-manifests/issues
|
|
body: |
|
|
{
|
|
"title": "Deploy failed: {{.app.metadata.name}}",
|
|
"body": "## Deployment Failure\n\n**App:** `{{.app.metadata.name}}`\n**Namespace:** `{{.app.spec.destination.namespace}}`\n**Sync status:** `{{.app.status.sync.status}}`\n**Health:** `{{.app.status.health.status}}`\n\n### Conditions\n```\n{{range .app.status.conditions}}{{.message}}\n{{end}}```\n\n[View in ArgoCD](https://argocd.olb42.com/applications/{{.app.metadata.name}})",
|
|
"labels": [1]
|
|
}
|
|
trigger.on-deploy-failed: |
|
|
- when: app.status.health.status == 'Degraded' || app.status.sync.status == 'Unknown'
|
|
send: [gitea-create-issue]
|