Mattermost
Parameters
apiURL
- the server url, e.g. https://mattermost.example.comtoken
- the bot tokeninsecureSkipVerify
- optional bool, true or false
Configuration
- Create a bot account and copy token after creating it
- Invite team
- Store token in
argocd-notifications-secret
Secret and configure Mattermost integration inargocd-notifications-cm
ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
data:
service.mattermost: |
apiURL: <api-url>
token: $mattermost-token
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
mattermost-token: token
Copy channel id
Create subscription for your Mattermost integration
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.<trigger-name>.mattermost: <channel-id>
Templates
You can reuse the template of slack.
Mattermost is compatible with attachments of Slack. See Mattermost Integration Guide.
template.app-deployed: |
message: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
mattermost:
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
}]
}]