From d06a1f6d368688e018fc407e17bd741fa59d1b4b Mon Sep 17 00:00:00 2001 From: Clement Venard Date: Mon, 27 Nov 2017 16:38:56 +0800 Subject: [PATCH] updated docker file --- DOCS.md | 93 +++++-------------------------- Dockerfile | 11 ++-- release/linux/amd64/drone-wechat | Bin 8361750 -> 8361750 bytes 3 files changed, 18 insertions(+), 86 deletions(-) diff --git a/DOCS.md b/DOCS.md index 13eb64f..1bea6f2 100644 --- a/DOCS.md +++ b/DOCS.md @@ -1,91 +1,24 @@ -Use the Webhook plugin to notify services via Webhook when a build completes. -You will need to supply Drone with outgoing Webhook URLs. +Use the wechat plugin to notify users during the Drone pipeline. -You can override the default configuration with the following parameters: +Please only use these paramters for now: * `access_token` - The access token for authorization -* `msgtype` - The type of message, either text, textcard * `agentid` - The agent id to send the message -* `touser` - The users to send the message to, @all for all users -* `toparty` - Party ID to send messages to -* `safe` - Whether to make this message confidential or not, 0 is false, 1 is - true. Defaults to `false` -* `skip_verify` - Skip verification of TLS certificates, defaults to `false` -* `content` - message content +* `msgurl` - The agent id to send the message +* `btntxt` - The text for the button on the card +* `title` - Title of the card +* `description` - Text description of the card ## Example The following is a sample configuration in your .drone.yml file: ```yaml -notify: - webhook: - urls: - - https://your.webhook/... - - https://your.other.webhook/... - headers: - - "Authorization=pa55word" -``` - -### 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 +wechat: + access-token: somelongasstoken + agentid: 12345 + msgurl: http://acoolwebsite.com + btntxt: click + title: Title for the card + description: This is the card body ``` diff --git a/Dockerfile b/Dockerfile index 6ea23d1..2b3c752 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ FROM plugins/base:multiarch -MAINTAINER Drone.IO Community +MAINTAINER Clement Venard LABEL org.label-schema.version=latest -LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-webhook.git" -LABEL org.label-schema.name="Drone Webhook" -LABEL org.label-schema.vendor="Drone.IO Community" +LABEL org.label-schema.vcs-url="https://github.com/clem109/drone-wechat.git" +LABEL org.label-schema.name="Drone Wechat" LABEL org.label-schema.schema-version="1.0" -ADD release/linux/amd64/drone-webhook /bin/ -ENTRYPOINT ["/bin/drone-webhook"] +ADD release/linux/amd64/drone-wechat /bin/ +ENTRYPOINT ["/bin/drone-wechat"] diff --git a/release/linux/amd64/drone-wechat b/release/linux/amd64/drone-wechat index de5ba12f20a13757a43098f046de443f6219ca97..eb01837fc5c46ec967243a5ee2363bb5be02ebdd 100755 GIT binary patch delta 788 zcmXZTO-zyj9LI5<=i%+KC^Q926kn+DB@HSmh_W}cH%JOAvJ6v$UP(=}40IjX+B!X( zPg`pX+d8&p2Ru1$p1st?LmfNh)}@d`_LceHK8Npb`_Fv(C(YoqQzykHwCYm9TcvdB z%H*W?oo4-#N>t~Oy|&q6d6f)hpZ!oQyYhny_IxZ>P^r^<bXeaFFhWKNHeoYN*n+JvqZDP>hH_NE0xK%99Xn738>&$QJ8DsfdNja+o!Eul zaH0`SXhsY6pcQS{3m4qjhy6H!c6e|Qhv3a-^u9$|7*5B{J{*Q0M{pD!IELdmfs;6e zPMk&;&fqN0;XE!NfFLfSI~zBL{?_W|zn5!D)j?P2tsDr8^TIcwV_B8mA%Bab)zD>V z(l&_gqQ~H>Fqtf-YHL{N7b|`VZLb8UrKV&`5Szg-uwK5;+mQ1TgHIa`vY_C(xMk%LR zHA?y~#-JEmGfKK8vG_N@)2A|FK*x_`fv+T^y4-LFo^Y^JBT5UySRt@cz}m^ tgajUA7$X?X&gGvBEh-5?ujZ;<+O#bWLfIc(Ym!~ z`5anX*w)Fl)`jZi!Oe49>ztR4%}yeR>J9U|y$xoi zZq%X<_1K2(@Sp)Z;Drx6u?xG=2tW2?rvPT~~WaT;gPk&0PDE9Hi-KZ|umTCX?sTImW)pT&|0{?Zg*DB$@dJg-EX zsZL)hHA;Sy*J?J~%uah)^hnkf(eOgJZDsirLaHwwE{L~iL%z^hV%ZnMS)4;Swe0Jx zZWsLt`(!81qYD>O_Q}Yf5lhXY6!<5-6|y>>k!t1NT1h(6VfwCH&6B^3YXj*>m3Xeb zOh;@cSz494{zKmG$n{31XA