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

Commit 88205cf

Browse files
chore: update notifications-engine (#293)
Signed-off-by: Ryota Sakamoto <[email protected]>
1 parent ed0ce0c commit 88205cf

File tree

5 files changed

+101
-3
lines changed

5 files changed

+101
-3
lines changed

docs/services/email.md

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

1314
## Example
1415

docs/services/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ metadata:
4747
* [Webhook](./webhook.md)
4848
* [Telegram](./telegram.md)
4949
* [Teams](./teams.md)
50+
* [Rocket.Chat](./rocketchat.md)

docs/services/rocketchat.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Rocket.Chat
2+
3+
## Parameters
4+
5+
The Rocket.Chat notification service configuration includes following settings:
6+
7+
* `email` - the Rocker.Chat user's email
8+
* `password` - the Rocker.Chat user's password
9+
* `alias` - optional alias that should be used to post message
10+
* `icon` - optional message icon
11+
* `avatar` - optional message avatar
12+
* `serverUrl` - optional Rocket.Chat server url
13+
14+
## Configuration
15+
16+
1. Login to your RocketChat instance
17+
2. Go to user management
18+
19+
![2](https://user-images.githubusercontent.com/15252187/115824993-7ccad900-a411-11eb-89de-6a0c4438ffdf.png)
20+
21+
3. Add new user with `bot` role. Also note that `Require password change` checkbox mus be not checked
22+
23+
![3](https://user-images.githubusercontent.com/15252187/115825174-b4d21c00-a411-11eb-8f20-cda48cea9fad.png)
24+
25+
4. Copy username and password that you was created for bot user
26+
5. Create a public or private channel, or a team, for this example `my_channel`
27+
6. Add your bot to this channel **otherwise it won't work**
28+
7. Store email and password in argocd_notifications-secret Secret
29+
30+
```yaml
31+
apiVersion: v1
32+
kind: Secret
33+
metadata:
34+
name: <secret-name>
35+
stringData:
36+
rocketchat-email: <email>
37+
rocketchat-password: <password>
38+
```
39+
40+
8. Finally, use these credentials to configure the RocketChat integration in the `argocd-configmap` config map:
41+
42+
```yaml
43+
apiVersion: v1
44+
kind: ConfigMap
45+
metadata:
46+
name: <config-map-name>
47+
data:
48+
service.rocketchat: |
49+
email: $rocketchat-email
50+
password: $rocketchat-password
51+
```
52+
53+
9. Create a subscription for your Rocket.Chat integration:
54+
55+
*Note: channel, team or user must be prefixed with # or @ elsewhere we will be interpretative destination as a room ID*
56+
57+
```yaml
58+
apiVersion: argoproj.io/v1alpha1
59+
kind: Application
60+
metadata:
61+
annotations:
62+
notifications.argoproj.io/subscribe.on-sync-succeeded.rocketchat: #my_channel
63+
```
64+
65+
## Templates
66+
67+
Notification templates can be customized with RocketChat [attachments](https://developer.rocket.chat/api/rest-api/methods/chat/postmessage#attachments-detail).
68+
69+
*Note: Attachments structure in Rocketchat is same with Slack attachments [feature](https://api.slack.com/messaging/composing/layouts).*
70+
71+
<!-- TODO: @sergeyshevch Need to add screenshot with RocketChat attachments -->
72+
73+
The message attachments can be specified in `attachments` string fields under `rocketchat` field:
74+
75+
```yaml
76+
template.app-sync-status: |
77+
message: |
78+
Application {{.app.metadata.name}} sync is {{.app.status.sync.status}}.
79+
Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
80+
rocketchat:
81+
attachments: |
82+
[{
83+
"title": "{{.app.metadata.name}}",
84+
"title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
85+
"color": "#18be52",
86+
"fields": [{
87+
"title": "Sync Status",
88+
"value": "{{.app.status.sync.status}}",
89+
"short": true
90+
}, {
91+
"title": "Repository",
92+
"value": "{{.app.spec.source.repoURL}}",
93+
"short": true
94+
}]
95+
}]
96+
```

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.20210507172642-597c59f3cb15
7+
github.com/argoproj/notifications-engine v0.2.1-0.20210527032340-6e7a43362ff1
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.20210507172642-597c59f3cb15 h1:18ggmBbQfKoP2zF/M76X6eVlCUF9SZsnlc9odvEHLv4=
97-
github.com/argoproj/notifications-engine v0.2.1-0.20210507172642-597c59f3cb15/go.mod h1:rKhm9LtebGKgLA/UtPtBeRUrrS/CT0U5az1jSfUiipw=
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=
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)