This repository was archived by the owner on Oct 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ The Email notification service sends email notifications using SMTP protocol and
10
10
* ` password ` - password
11
11
* ` from ` - from email address
12
12
* ` html ` - optional bool, true or false
13
+ * ` insecure_skip_verify ` - optional bool, true or false
13
14
14
15
## Example
15
16
Original file line number Diff line number Diff line change
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
+
1
15
## Configuration
2
16
3
17
1 . Create Slack Application using https://api.slack.com/apps?new_app=1
@@ -33,10 +47,7 @@ metadata:
33
47
name: <config-map-name>
34
48
data:
35
49
service.slack: |
36
- apiURL: <url> # optional URL, e.g. https://example.com/api
37
50
token: $slack-token
38
- username: <override-username> # optional username
39
- icon: <override-icon> # optional icon for the message (supports both emoij and url notation)
40
51
` ` `
41
52
42
53
10. Add annotation in application yaml file to enable notifications for specific argocd app
Original file line number Diff line number Diff line change @@ -138,3 +138,40 @@ data:
138
138
method: POST
139
139
body: key1=value1&key2=value2
140
140
` ` `
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
+ ` ` `
Original file line number Diff line number Diff line change 4
4
5
5
require (
6
6
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
8
8
github.com/evanphx/json-patch v4.9.0+incompatible
9
9
github.com/ghodss/yaml v1.0.0
10
10
github.com/golang/mock v1.4.4
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ github.com/argoproj/argo-cd/v2 v2.0.0-rc3 h1:jBuz8qqLL0gG6Nb892x3+eP+v/wjQpkdSOl
93
93
github.com/argoproj/argo-cd/v2 v2.0.0-rc3 /go.mod h1:Rw7fuyae0v8b3KMJoZp8jf5A2tBP2dQ8uWj9HTRZITo =
94
94
github.com/argoproj/gitops-engine v0.3.1 h1:wM4RUzH54sWdchD7Ws8UdAIsjk08BmjN9bLuW79xKWk =
95
95
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 =
98
98
github.com/argoproj/pkg v0.2.0 h1:ETgC600kr8WcAi3MEVY5sA1H7H/u1/IysYOobwsZ8No =
99
99
github.com/argoproj/pkg v0.2.0 /go.mod h1:F4TZgInLUEjzsWFB/BTJBsewoEy0ucnKSq6vmQiD/yc =
100
100
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e /go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o =
You can’t perform that action at this time.
0 commit comments