Drone plugins > Matrixchat Notifications
matrix.svg

Matrixchat Notifications

by SpotlightKid


A plugin to send notifications to Matrix chat rooms from CI pipeline steps. Supports Jinja message templates and Markdown rendering.

Example

kind: pipeline
type: docker
name: default

steps:
- name: notify
  image: spotlightkid/drone-matrixchat-notify
  settings:
    homeserver: 'https://matrix.org'
    roomid: '!xxxxxx@matrix.org'
    userid: '@drone-bot@matrix.org'
    password:
      from_secret: drone-bot-pw
    markdown: 'yes'
    template: |
      `${DRONE_REPO}` build #${DRONE_BUILD_NUMBER} status: **${DRONE_BUILD_STATUS}**

      ${DRONE_PULL_REQUEST_TITLE}](${DRONE_COMMIT_LINK})

Properties

  • roomid

    stringrequired

    ID of matrix chat room to send messages to (ID, not alias).

    Default: none

  • userid

    stringrequired

    Matrix user ID to send message as (ID, not username).

    Default: none

  • password

    stringrequired

    Password to use for authenticating the user set with `userid`. Either a password or an access token is required.

    Secret recommended

    Default: none

  • accesstoken

    stringrequired

    Access token to use for authentication instead of `password`. Either an access token or a password is required.

    Secret recommended

    Default: none

  • allowed_attrs

    arrayoptional

    List or string with comma-separated list of HTML attribute names or dict mapping tag names to lists of attributes names.

    Default: `DEFAULT_ALLOWED_ATTRS`

  • allowed_tags

    arrayoptional

    List or set or string with comma-separated list of HTML tag names. HTML tags not included will be stripped from the HTML output generated by rendering a Markdown message template.

    Default: `DEFAULT_ALLOWED_TAGS`

  • deviceid

    stringoptional

    Device ID to send with access token.

    Default: none

  • devicename

    stringoptional

    Device name to send with access token.

    Default: none

  • homeserver

    stringoptional

    The Matrix homeserver URL.

    Default: https://matrix.org

  • jinja

    booleanoptional

    If set to true, `yes`, `y`, `true`, `t`, `on` or `1`, the message template is rendered with the Jinja templating engine.

    Default: none

  • markdown

    booleanoptional

    If set to true, `yes`, `y`, `true`, `t`, `on` or `1`, the message resulting from template substtution is considered to be in Markdown format and will be rendered to HTML.

    Default: none

  • pass_environment

    arrayoptional

    Comma-separated white-list of environment variable names or name shell-glob patterns. Only environment variables matching any of the given names or patterns will be available as valid placeholders in the message template.

    Default: DRONE_*

  • markdown_extensions

    arrayoptional

    Comma-separated list of enabled Markdown extensions.

    Default: admonition, extra, sane_lists, smarty

  • template

    stringoptional

    The message template. Valid placeholders (example: `${DRONE_REPO}`) will be substituted with the values of the matching environment variables (subject to filtering according to the `pass_environment` setting).

    Default: ${DRONE_BUILD_STATUS}