mirror of
https://github.com/lizheming/drone-wechat.git
synced 2026-06-04 18:33:46 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6288e4afac | |||
| 3e0dec29ee | |||
| 46b144516a | |||
| f6d38f75a8 | |||
| 58ca98d95f | |||
| b1482817f1 | |||
| 7c09b00e73 | |||
| 27431b7e9d | |||
| a3b45bf3d7 | |||
| 547d96caea | |||
| ebb4fa4536 | |||
| 5b410441e6 | |||
| a10b8c2982 | |||
| 31457c2db5 | |||
| 8f3fadac27 |
+36
-34
@@ -1,4 +1,4 @@
|
|||||||
kind: pipline
|
kind: pipeline
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -20,6 +20,7 @@ steps:
|
|||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
- name: coveralls
|
- name: coveralls
|
||||||
|
pull: true
|
||||||
image: lizheming/drone-coveralls
|
image: lizheming/drone-coveralls
|
||||||
environment:
|
environment:
|
||||||
COVERALLS_REPO_TOKEN:
|
COVERALLS_REPO_TOKEN:
|
||||||
@@ -29,12 +30,12 @@ steps:
|
|||||||
files:
|
files:
|
||||||
- coverage/lcov.info
|
- coverage/lcov.info
|
||||||
|
|
||||||
- name: code analysis
|
# - name: code analysis
|
||||||
image: jgentry/drone-sonar
|
# image: jgentry/drone-sonar
|
||||||
environment:
|
# environment:
|
||||||
sonar_host: "https://sonarcloud.io"
|
# sonar_host: "https://sonarcloud.io"
|
||||||
sonar_login:
|
# sonar_login:
|
||||||
from_secret: sonar_token
|
# from_secret: sonar_token
|
||||||
|
|
||||||
# - name: rebuild-cache
|
# - name: rebuild-cache
|
||||||
# image: drillster/drone-volume-cache
|
# image: drillster/drone-volume-cache
|
||||||
@@ -46,34 +47,35 @@ steps:
|
|||||||
# mount:
|
# mount:
|
||||||
# - ./node_modules
|
# - ./node_modules
|
||||||
|
|
||||||
- name: wechat
|
# - name: wechat
|
||||||
image: lizheming/drone-wechat
|
# image: lizheming/drone-wechat
|
||||||
pull: always
|
# pull: always
|
||||||
settings:
|
# settings:
|
||||||
title: >
|
# title: >
|
||||||
{% if success %}
|
# {% if success %}
|
||||||
✅ {{repo.owner}}/{{repo.name}} 第 {{build.number}} 次构建成功!
|
# ✅ {{repo.owner}}/{{repo.name}} 第 {{build.number}} 次构建成功!
|
||||||
{% else %}
|
# {% else %}
|
||||||
❌ {{repo.owner}}/{{repo.name}} 第 {{build.number}} 次构建失败了,快来修理下吧。
|
# ❌ {{repo.owner}}/{{repo.name}} 第 {{build.number}} 次构建失败了,快来修理下吧。
|
||||||
{% endif %}
|
# {% endif %}
|
||||||
corpid:
|
# corpid:
|
||||||
from_secret: corpid
|
# from_secret: corpid
|
||||||
corp_secret:
|
# corp_secret:
|
||||||
from_secret: corp_secret
|
# from_secret: corp_secret
|
||||||
agent_id:
|
# agent_id:
|
||||||
from_secret: agent_id
|
# from_secret: agent_id
|
||||||
message: >
|
# to_user: "@all"
|
||||||
{% if success %}
|
# message: >
|
||||||
😊主人,{{repo.owner}}/{{repo.name}}第{{build.number}}次构建成功!
|
# {% if success %}
|
||||||
{% else %}
|
# 😊主人,{{repo.owner}}/{{repo.name}}第{{build.number}}次构建成功!
|
||||||
😭主人,{{repo.owner}}/{{repo.name}}第{{build.number}}次构建失败了,快来修理下吧。
|
# {% else %}
|
||||||
{% endif %}
|
# 😭主人,{{repo.owner}}/{{repo.name}}第{{build.number}}次构建失败了,快来修理下吧。
|
||||||
when:
|
# {% endif %}
|
||||||
status:
|
# when:
|
||||||
- success
|
# status:
|
||||||
- failure
|
# - success
|
||||||
|
# - failure
|
||||||
|
|
||||||
# volumes:
|
# volumes:
|
||||||
# - name: cache
|
# - name: cache
|
||||||
# host:
|
# host:
|
||||||
# path: /tmp/cache
|
# path: /tmp/cache
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ configParser({
|
|||||||
},
|
},
|
||||||
to_user: {
|
to_user: {
|
||||||
usage: 'The user ids to send the message to',
|
usage: 'The user ids to send the message to',
|
||||||
def: '@all',
|
|
||||||
env: 'PLUGIN_TO_USER,WECHAT_TO_USER'
|
env: 'PLUGIN_TO_USER,WECHAT_TO_USER'
|
||||||
},
|
},
|
||||||
to_tag: {
|
to_tag: {
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "drone-wechat",
|
"name": "drone-wechat",
|
||||||
"version": "1.1.2",
|
"version": "1.1.7",
|
||||||
"description": "drone wechat notification plugin",
|
"description": "drone wechat notification plugin",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"homepage": "https://github.com/lizheming/drone-wechat#readme",
|
"homepage": "https://github.com/lizheming/drone-wechat#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"coveralls": "^3.0.2",
|
"coveralls": "^3.0.2",
|
||||||
"drone-render": "^1.0.0",
|
"drone-render": "^1.0.4",
|
||||||
"request": "^2.83.0",
|
"request": "^2.83.0",
|
||||||
"request-promise-native": "^1.0.5"
|
"request-promise-native": "^1.0.5"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -55,9 +55,13 @@ function sendMsgFromWork({
|
|||||||
safe,
|
safe,
|
||||||
title
|
title
|
||||||
}) {
|
}) {
|
||||||
title = render(title);
|
title = title && render(title);
|
||||||
const description = render(message);
|
totag = totag && render(totag);
|
||||||
|
btntext = btntext && render(btntext);
|
||||||
|
const description = message && render(message);
|
||||||
|
|
||||||
const textcard = { title, url, btntext, description };
|
const textcard = { title, url, btntext, description };
|
||||||
|
|
||||||
return request({
|
return request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: 'https://qyapi.weixin.qq.com/cgi-bin/message/send',
|
url: 'https://qyapi.weixin.qq.com/cgi-bin/message/send',
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ test('send wechat with corp id', async t => {
|
|||||||
PLUGIN_MESSAGE: MESSAGE,
|
PLUGIN_MESSAGE: MESSAGE,
|
||||||
PLUGIN_TO_PARTY: 'party',
|
PLUGIN_TO_PARTY: 'party',
|
||||||
PLUGIN_TO_TAG: 'tag',
|
PLUGIN_TO_TAG: 'tag',
|
||||||
|
PLUGIN_TO_USER: '@all',
|
||||||
PLUGIN_MSG_URL: '',
|
PLUGIN_MSG_URL: '',
|
||||||
PLUGIN_BTN_TEXT: 'more',
|
PLUGIN_BTN_TEXT: 'more',
|
||||||
PLUGIN_AGENT_ID: 1122
|
PLUGIN_AGENT_ID: 1122
|
||||||
|
|||||||
Reference in New Issue
Block a user