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

Commit 2c4df88

Browse files
chore: update notifications-engine (#316)
Signed-off-by: Ryota Sakamoto <sakamo.ryota+github@gmail.com>
1 parent 66216fe commit 2c4df88

File tree

5 files changed

+55
-6
lines changed

5 files changed

+55
-6
lines changed

docs/services/email.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The Email notification service sends email notifications using SMTP protocol and
1010
* `password` - password
1111
* `from` - from email address
1212
* `html` - optional bool, true or false
13+
* `insecure_skip_verify` - optional bool, true or false
1314

1415
## Example
1516

docs/services/slack.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Slack
2+
3+
If you want to send message using incoming webhook, you can use [webhook](./webhook.md#send-slack).
4+
5+
## Parameters
6+
7+
The Slack notification service configuration includes following settings:
8+
9+
* `token` - the app token
10+
* `apiURL` - optional, the server url, e.g. https://example.com/api
11+
* `username` - optional, the app username
12+
* `icon` - optional, the app icon, e.g. :robot_face: or https://example.com/image.png
13+
* `insecureSkipVerify` - optional bool, true or false
14+
115
## Configuration
216

317
1. Create Slack Application using https://api.slack.com/apps?new_app=1
@@ -33,10 +47,7 @@ metadata:
3347
name: <config-map-name>
3448
data:
3549
service.slack: |
36-
apiURL: <url> # optional URL, e.g. https://example.com/api
3750
token: $slack-token
38-
username: <override-username> # optional username
39-
icon: <override-icon> # optional icon for the message (supports both emoij and url notation)
4051
```
4152

4253
10. Add annotation in application yaml file to enable notifications for specific argocd app

docs/services/webhook.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,40 @@ data:
138138
method: POST
139139
body: key1=value1&key2=value2
140140
```
141+
142+
### Send Slack
143+
144+
```yaml
145+
apiVersion: v1
146+
kind: ConfigMap
147+
metadata:
148+
name: <config-map-name>
149+
data:
150+
service.webhook.slack_webhook: |
151+
url: https://hooks.slack.com/services/xxxxx
152+
headers:
153+
- name: Content-Type
154+
value: application/json
155+
156+
template.send-slack: |
157+
webhook:
158+
slack_webhook:
159+
method: POST
160+
body: |
161+
{
162+
"attachments": [{
163+
"title": "{{.app.metadata.name}}",
164+
"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
165+
"color": "#18be52",
166+
"fields": [{
167+
"title": "Sync Status",
168+
"value": "{{.app.status.sync.status}}",
169+
"short": true
170+
}, {
171+
"title": "Repository",
172+
"value": "{{.app.spec.source.repoURL}}",
173+
"short": true
174+
}]
175+
}]
176+
}
177+
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.16
44

55
require (
66
github.com/argoproj/argo-cd/v2 v2.0.0-rc3
7-
github.com/argoproj/notifications-engine v0.2.1-0.20210527032340-6e7a43362ff1
7+
github.com/argoproj/notifications-engine v0.2.1-0.20210729153923-a15e78044105
88
github.com/evanphx/json-patch v4.9.0+incompatible
99
github.com/ghodss/yaml v1.0.0
1010
github.com/golang/mock v1.4.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ github.com/argoproj/argo-cd/v2 v2.0.0-rc3 h1:jBuz8qqLL0gG6Nb892x3+eP+v/wjQpkdSOl
9393
github.com/argoproj/argo-cd/v2 v2.0.0-rc3/go.mod h1:Rw7fuyae0v8b3KMJoZp8jf5A2tBP2dQ8uWj9HTRZITo=
9494
github.com/argoproj/gitops-engine v0.3.1 h1:wM4RUzH54sWdchD7Ws8UdAIsjk08BmjN9bLuW79xKWk=
9595
github.com/argoproj/gitops-engine v0.3.1/go.mod h1:IBHhAkqlC+3r/wBWUitWSidQhPzlLoSTWp2htq3dyQk=
96-
github.com/argoproj/notifications-engine v0.2.1-0.20210527032340-6e7a43362ff1 h1:xsnbKslPaYqedr5OXRU68raykzLx2zkLtmRo9xhDcvU=
97-
github.com/argoproj/notifications-engine v0.2.1-0.20210527032340-6e7a43362ff1/go.mod h1:rKhm9LtebGKgLA/UtPtBeRUrrS/CT0U5az1jSfUiipw=
96+
github.com/argoproj/notifications-engine v0.2.1-0.20210729153923-a15e78044105 h1:V5cNAPIxNMYr6EIL2dRSZa5qCsqkXa+KknuZXYb9JIg=
97+
github.com/argoproj/notifications-engine v0.2.1-0.20210729153923-a15e78044105/go.mod h1:rKhm9LtebGKgLA/UtPtBeRUrrS/CT0U5az1jSfUiipw=
9898
github.com/argoproj/pkg v0.2.0 h1:ETgC600kr8WcAi3MEVY5sA1H7H/u1/IysYOobwsZ8No=
9999
github.com/argoproj/pkg v0.2.0/go.mod h1:F4TZgInLUEjzsWFB/BTJBsewoEy0ucnKSq6vmQiD/yc=
100100
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=

0 commit comments

Comments
 (0)