Author: Robert Kaussow <mail@thegeeklab.de>
Date:   Sat May 28 15:24:23 2022 +0200

    docs: refactor plugin properties
This commit is contained in:
Robert Kaussow 2022-05-28 13:33:27 +00:00
parent a5e971d04b
commit 9a0d013f5d
2 changed files with 65 additions and 24 deletions

View File

@ -17,6 +17,32 @@ Drone plugin to to send messages to a Matrix room.
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
## Usage
```YAML
kind: pipeline
name: default
steps:
- name: notify
image: thegeeklab/matrix
settings:
homeserver: https://matrix.org
roomid: abcdefghijklmnopqrstuvwxyz:matrix.org
username: octocat
password: secret
```
### Parameters
<!-- prettier-ignore-start -->
<!-- spellchecker-disable -->
{{< propertylist name=drone-matrix.data >}}
<!-- spellchecker-enable -->
<!-- prettier-ignore-end -->
### Examples
## Build
Build the binary with the following command:
@ -36,7 +62,7 @@ Build the Docker image with the following command:
docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-matrix .
```
## Usage
## Test
```Shell
docker run --rm \
@ -47,26 +73,3 @@ docker run --rm \
-w $(pwd) \
thegeeklab/drone-matrix
```
### Parameters
username
: sets username for authentication
password
: sets password for authentication
user_id
: sets userid for authentication
access_token
: sets access token for authentication
homeserver
: sets matrix home server url to use (default `https://matrix.org`)
roomid
: sets roomid to send messages to
template
: sets message template; used default template `build {{ build.status }} [{{ repo.owner }}/{{ repo.name }}#{{ truncate build.commit 8 }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}`

38
data/data.yaml Normal file
View File

@ -0,0 +1,38 @@
---
properties:
username:
description: The authentication username. If set, password is required as well.
type: string
required: false
password:
description: The authentication password.
type: string
required: false
user_id:
description: The authentication user uid. If set, access token is required as well.
type: string
required: false
access_token:
description: The authentication access token.
type: string
required: false
homeserver:
description: The Matrix homeserver url to use.
defaultValue: https://matrix.org
type: string
required: false
roomid:
description: The Room ID to send messages to.
type: string
required: false
template:
description: Golang Template for the messages.
defaultValue: build {{ build.status }} [{{ repo.owner }}/{{ repo.name }}#{{ truncate build.commit 8 }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
type: string
required: false