-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
69 lines (63 loc) · 1.97 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This drone config file is working with BlockABC drone service. Because we installed some extra plugins, it is no suit
# for any other environment.
pipeline:
# Recall node_modules from cache
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- ./node_modules
volumes:
- /tmp/cache/drone/abcwallet.js:/cache
# build
build:
image: node:12.4.0
commands:
- npm install
- npm run build
# Memorize node_modules
rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
- ./node_modules
volumes:
- /tmp/cache/drone/abcwallet.js:/cache
# Depoly example page to one of our server
deploy_hk_fe1_b:
image: drillster/drone-rsync
hosts: ['47.75.126.140']
user: root
secrets: [ rsync_key ]
source: ./
target: /data/code/abcwallet.js
prescript:
- mkdir -p /data/code/abcwallet.js
script:
- cd /data/code/abcwallet.js
- npm run pm2:reload
when:
branch: [master]
# Use drone wechat plugin to send notification
wechat_success:
image: lizheming/drone-wechat
secrets: [plugin_corpid, plugin_corp_secret, plugin_agent_id]
title: '${DRONE_REPO_NAME} ${DRONE_COMMIT_BRANCH} 构建成功✅'
message: "分支: ${DRONE_COMMIT_BRANCH} 序列: ${DRONE_BUILD_NUMBER}. 提交人: ${DRONE_COMMIT_AUTHOR}. 查看详情: ${DRONE_BUILD_LINK} "
to_user: 'jeff'
to_party: 2
msg_url: ${DRONE_BUILD_LINK}
btn_txt: 详情
when:
status: [ success ]
wechat_failed:
image: lizheming/drone-wechat
secrets: [plugin_corpid, plugin_corp_secret, plugin_agent_id]
title: '${DRONE_REPO_NAME} ${DRONE_COMMIT_BRANCH} 构建失败‼️'
message: "分支: ${DRONE_COMMIT_BRANCH} 序列: ${DRONE_BUILD_NUMBER}. 提交人: ${DRONE_COMMIT_AUTHOR}. 查看详情: ${DRONE_BUILD_LINK} "
to_user: 'jeff'
to_party: 2 #前端组
msg_url: ${DRONE_BUILD_LINK}
btn_txt: 失败详情
when:
status: [ failure ]