Skip to content

Mattermost

Parameters

  • apiURL - the server url, e.g. https://mattermost.example.com
  • token - the bot token
  • insecureSkipVerify - optional bool, true or false

Configuration

  1. Create a bot account and copy token after creating it 1
  2. Invite team 2
  3. Store token in argo-rollouts-notification-secret Secret and configure Mattermost integration in argo-rollouts-notification-configmap ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  name: argo-rollouts-notification-configmap
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
        }]
      }]