Drone CI Plugins
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

drone-matrix

Build Status Docker Hub Quay.io GitHub contributors Source: GitHub License: MIT

Drone plugin to to send messages to a Matrix room.

Usage

kind: pipeline
name: default

steps:
- name: notify
  image: thegeeklab/matrix
  settings:
    homeserver: https://matrix.org
    roomid: abcdefghijklmnopqrstuvwxyz:matrix.org
    username: octocat
    password: secret

Parameters

access_token optional string
Authentication access token.
Default: none
homeserver optional string
The Matrix homeserver url to use.
Default: https://matrix.org
password optional string
Authentication password.
Default: none
roomid optional string
Room ID to send messages to.
Default: none
template optional string
Golang template for the messages.
Default: build {{ build.status }} [{{ repo.owner }}/{{ repo.name }}#{{ truncate build.commit 8 }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
user_id optional string
Aauthentication User ID. If set, the access_token parameter is required as well.
Default: none
username optional string
Authentication username. If set, the password parameter is required as well.
Default: none

Build

Build the binary with the following command:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

make build

Build the Docker image with the following command:

docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-matrix .

Test

docker run --rm \
  -e PLUGIN_ROOMID=0123456789abcdef:matrix.org \
  -e PLUGIN_USERNAME=yourbot \
  -e PLUGIN_PASSWORD=p455w0rd \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  thegeeklab/drone-matrix