Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
docs: add app-deployed template
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmt committed Jan 4, 2021
1 parent 6ec4a33 commit 149bd8e
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 3 deletions.
39 changes: 38 additions & 1 deletion catalog/install.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
apiVersion: v1
data:
template.app-deployed: |
body: |
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
slack:
attachments: |
[{
"title": "{{ .app.metadata.name}}",
"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"color": "#18be52",
"fields": [
{
"title": "Sync Status",
"value": "{{.app.status.sync.status}}",
"short": true
},
{
"title": "Repository",
"value": "{{.app.spec.source.repoURL}}",
"short": true
},
{
"title": "Revision",
"value": "{{.app.status.sync.revision}}",
"short": true
}
{{range $index, $c := .app.status.conditions}}
{{if not $index}},{{end}}
{{if $index}},{{end}}
{
"title": "{{$c.type}}",
"value": "{{$c.message}}",
"short": true
}
{{end}}
]
}]
title: New version of an application {{.app.metadata.name}} is up and running.
template.app-health-degraded: |
body: |
{{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded.
Expand Down Expand Up @@ -122,7 +159,7 @@ data:
- description: Application is synced and healthy. Triggered once per commit.
oncePer: app.status.sync.revision
send:
- app-sync-succeeded
- app-deployed
when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'
trigger.on-health-degraded: |
- description: Application has degraded
Expand Down
36 changes: 36 additions & 0 deletions catalog/templates/app-deployed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: "New version of an application {{.app.metadata.name}} is up and running."
body: |
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
slack:
attachments: |
[{
"title": "{{ .app.metadata.name}}",
"title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
"color": "#18be52",
"fields": [
{
"title": "Sync Status",
"value": "{{.app.status.sync.status}}",
"short": true
},
{
"title": "Repository",
"value": "{{.app.spec.source.repoURL}}",
"short": true
},
{
"title": "Revision",
"value": "{{.app.status.sync.revision}}",
"short": true
}
{{range $index, $c := .app.status.conditions}}
{{if not $index}},{{end}}
{{if $index}},{{end}}
{
"title": "{{$c.type}}",
"value": "{{$c.message}}",
"short": true
}
{{end}}
]
}]
2 changes: 1 addition & 1 deletion catalog/triggers/on-deployed.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'
description: Application is synced and healthy. Triggered once per commit.
send: [app-sync-succeeded]
send: [app-deployed]
oncePer: app.status.sync.revision
10 changes: 9 additions & 1 deletion docs/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
## Triggers
| NAME | DESCRIPTION | TEMPLATE |
|------------------------|---------------------------------------------------------------|-----------------------------------------------------|
| on-deployed | Application is synced and healthy. Triggered once per commit. | [app-sync-succeeded](#app-sync-succeeded) |
| on-deployed | Application is synced and healthy. Triggered once per commit. | [app-deployed](#app-deployed) |
| on-health-degraded | Application has degraded | [app-health-degraded](#app-health-degraded) |
| on-sync-failed | Application syncing has failed | [app-sync-failed](#app-sync-failed) |
| on-sync-running | Application is being synced | [app-sync-running](#app-sync-running) |
| on-sync-status-unknown | Application status is 'Unknown' | [app-sync-status-unknown](#app-sync-status-unknown) |
| on-sync-succeeded | Application syncing has succeeded | [app-sync-succeeded](#app-sync-succeeded) |

## Templates
### app-deployed
**title**: `New version of an application {{.app.metadata.name}} is up and running.`

**body**:
```
{{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
```
### app-health-degraded
**title**: `Application {{.app.metadata.name}} has degraded.`

Expand Down

0 comments on commit 149bd8e

Please sign in to comment.