docs: refactor plugin properties

This commit is contained in:
Robert Kaussow 2022-05-28 15:24:23 +02:00
parent bd106aa037
commit bbb8dbb009
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
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
_docs/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