mirror of
https://github.com/clem109/drone-wechat.git
synced 2026-06-04 18:33:45 +08:00
updated docker file
This commit is contained in:
@@ -1,91 +1,24 @@
|
|||||||
Use the Webhook plugin to notify services via Webhook when a build completes.
|
Use the wechat plugin to notify users during the Drone pipeline.
|
||||||
You will need to supply Drone with outgoing Webhook URLs.
|
|
||||||
|
|
||||||
You can override the default configuration with the following parameters:
|
Please only use these paramters for now:
|
||||||
|
|
||||||
* `access_token` - The access token for authorization
|
* `access_token` - The access token for authorization
|
||||||
* `msgtype` - The type of message, either text, textcard
|
|
||||||
* `agentid` - The agent id to send the message
|
* `agentid` - The agent id to send the message
|
||||||
* `touser` - The users to send the message to, @all for all users
|
* `msgurl` - The agent id to send the message
|
||||||
* `toparty` - Party ID to send messages to
|
* `btntxt` - The text for the button on the card
|
||||||
* `safe` - Whether to make this message confidential or not, 0 is false, 1 is
|
* `title` - Title of the card
|
||||||
true. Defaults to `false`
|
* `description` - Text description of the card
|
||||||
* `skip_verify` - Skip verification of TLS certificates, defaults to `false`
|
|
||||||
* `content` - message content
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The following is a sample configuration in your .drone.yml file:
|
The following is a sample configuration in your .drone.yml file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notify:
|
wechat:
|
||||||
webhook:
|
access-token: somelongasstoken
|
||||||
urls:
|
agentid: 12345
|
||||||
- https://your.webhook/...
|
msgurl: http://acoolwebsite.com
|
||||||
- https://your.other.webhook/...
|
btntxt: click
|
||||||
headers:
|
title: Title for the card
|
||||||
- "Authorization=pa55word"
|
description: This is the card body
|
||||||
```
|
|
||||||
|
|
||||||
### Custom Body
|
|
||||||
|
|
||||||
In some cases you may want to submit a custom payload in the body of your hook.
|
|
||||||
For this usage the following additional parameters should be used:
|
|
||||||
|
|
||||||
* `template` - Handlebars template to create a custom payload body. See
|
|
||||||
[docs](http://handlebarsjs.com/)
|
|
||||||
* `content_type` - HTTP request content type, defaults to `application/json`
|
|
||||||
|
|
||||||
Example configuration that generate a custom Yaml payload:
|
|
||||||
|
|
||||||
TBD
|
|
||||||
|
|
||||||
### Basic Authentication
|
|
||||||
|
|
||||||
> It is important to note that with HTTP Basic Authentication the provided
|
|
||||||
> username and password are not encrypted.
|
|
||||||
|
|
||||||
In some cases your webhook may need to authenticate with another service. You
|
|
||||||
can set the basic `Authentication` header with a username and password. For
|
|
||||||
these use cases we expose the following additional parameters:
|
|
||||||
|
|
||||||
* Sets the request's `Authorization` header to use HTTP Basic Authentication
|
|
||||||
with the provided username and password below
|
|
||||||
* `username` - The username as a string
|
|
||||||
* `password` - The password as a string
|
|
||||||
|
|
||||||
Example configuration to include HTTP Basic Authentication:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
notify:
|
|
||||||
webhook:
|
|
||||||
method: POST
|
|
||||||
username: myusername
|
|
||||||
password: mypassword
|
|
||||||
urls:
|
|
||||||
- https://tower.example.com/...
|
|
||||||
```
|
|
||||||
|
|
||||||
### Debugging Webhooks
|
|
||||||
|
|
||||||
In some cases complicated webhooks may need debugging to ensure `urls`,
|
|
||||||
`template`, `auth` and more a properly configured. For these use cases we expose
|
|
||||||
the following `debug` parameter:
|
|
||||||
|
|
||||||
* `debug` - If `true` it will print out each URL request and response
|
|
||||||
information
|
|
||||||
|
|
||||||
Example configuration to include the `debug` parameter:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
notify:
|
|
||||||
webhook:
|
|
||||||
debug: true
|
|
||||||
method: POST
|
|
||||||
username: myusername
|
|
||||||
password: mypassword
|
|
||||||
urls:
|
|
||||||
- http://tower.example.com/api/v1/job_templates/44/launch/
|
|
||||||
- http://tower.example.com/api/v1/job_templates/45/launch/
|
|
||||||
content_type: application/json
|
|
||||||
```
|
```
|
||||||
|
|||||||
+5
-6
@@ -1,11 +1,10 @@
|
|||||||
FROM plugins/base:multiarch
|
FROM plugins/base:multiarch
|
||||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
MAINTAINER Clement Venard <cvenard@gmail.com>
|
||||||
|
|
||||||
LABEL org.label-schema.version=latest
|
LABEL org.label-schema.version=latest
|
||||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-webhook.git"
|
LABEL org.label-schema.vcs-url="https://github.com/clem109/drone-wechat.git"
|
||||||
LABEL org.label-schema.name="Drone Webhook"
|
LABEL org.label-schema.name="Drone Wechat"
|
||||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
|
||||||
LABEL org.label-schema.schema-version="1.0"
|
LABEL org.label-schema.schema-version="1.0"
|
||||||
|
|
||||||
ADD release/linux/amd64/drone-webhook /bin/
|
ADD release/linux/amd64/drone-wechat /bin/
|
||||||
ENTRYPOINT ["/bin/drone-webhook"]
|
ENTRYPOINT ["/bin/drone-wechat"]
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user