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

Commit

Permalink
feat: ArgoCD Notifications for Created, Deleted status (#231)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Matyushentsev <[email protected]>
  • Loading branch information
Alexander Matyushentsev committed Apr 4, 2021
1 parent 1bb7e92 commit 1e6889d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
24 changes: 24 additions & 0 deletions catalog/install.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apiVersion: v1
data:
template.app-created: |
email:
subject: Application {{.app.metadata.name}} has been created.
message: Application {{.app.metadata.name}} has been created.
teams:
title: Application {{.app.metadata.name}} has been created.
template.app-deleted: |
email:
subject: Application {{.app.metadata.name}} has been deleted.
message: Application {{.app.metadata.name}} has been deleted.
teams:
title: Application {{.app.metadata.name}} has been deleted.
template.app-deployed: |
email:
subject: New version of an application {{.app.metadata.name}} is up and running.
Expand Down Expand Up @@ -451,6 +463,18 @@ data:
}]
}]
title: Application {{.app.metadata.name}} has been successfully synced
trigger.on-created: |
- description: Application is created.
oncePer: app.metadata.name
send:
- app-created
when: "true"
trigger.on-deleted: |
- description: Application is deleted.
oncePer: app.metadata.name
send:
- app-deleted
when: app.metadata.deletionTimestamp != nil
trigger.on-deployed: |
- description: Application is synced and healthy. Triggered once per commit.
oncePer: app.status.operationState.syncResult.revision
Expand Down
5 changes: 5 additions & 0 deletions catalog/templates/app-created.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
message: &message Application {{.app.metadata.name}} has been created.
email:
subject: *message
teams:
title: *message
5 changes: 5 additions & 0 deletions catalog/templates/app-deleted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
message: &message Application {{.app.metadata.name}} has been deleted.
email:
subject: *message
teams:
title: *message
4 changes: 4 additions & 0 deletions catalog/triggers/on-created.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- when: true
description: Application is created.
send: [app-created]
oncePer: app.metadata.name
4 changes: 4 additions & 0 deletions catalog/triggers/on-deleted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- when: app.metadata.deletionTimestamp != nil
description: Application is deleted.
send: [app-deleted]
oncePer: app.metadata.name
22 changes: 22 additions & 0 deletions docs/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
## Triggers
| NAME | DESCRIPTION | TEMPLATE |
|------------------------|---------------------------------------------------------------|-----------------------------------------------------|
| on-created | Application is created. | [app-created](#app-created) |
| on-deleted | Application is deleted. | [app-deleted](#app-deleted) |
| 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) |
Expand All @@ -10,6 +12,26 @@
| on-sync-succeeded | Application syncing has succeeded | [app-sync-succeeded](#app-sync-succeeded) |

## Templates
### app-created
**definition**:
```yaml
email:
subject: Application {{.app.metadata.name}} has been created.
message: Application {{.app.metadata.name}} has been created.
teams:
title: Application {{.app.metadata.name}} has been created.

```
### app-deleted
**definition**:
```yaml
email:
subject: Application {{.app.metadata.name}} has been deleted.
message: Application {{.app.metadata.name}} has been deleted.
teams:
title: Application {{.app.metadata.name}} has been deleted.

```
### app-deployed
**definition**:
```yaml
Expand Down

0 comments on commit 1e6889d

Please sign in to comment.