Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 2.11 KB

mattermost.md

File metadata and controls

78 lines (65 loc) · 2.11 KB

Mattermost

Parameters

Configuration

  1. Create a bot account and copy token after creating it 1
  2. Invite team 2
  3. Store token in argocd-notifications-secret Secret and configure Mattermost integration in argocd-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
  1. Copy channel id 4

  2. 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
        }]
      }]