-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone.yml
60 lines (56 loc) · 1.91 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
workspace:
base: /root
path: /wxapi
pipeline:
docker_auth_micro:
image: plugins/docker
repo: registry.cn-shanghai.aliyuncs.com/xugopher/wx_micro_auth
target: production
registry: registry.cn-shanghai.aliyuncs.com
secrets: [docker_username, docker_password]
dockerfile: ./auth/Dockerfile
docker_auth_api:
image: plugins/docker
repo: registry.cn-shanghai.aliyuncs.com/xugopher/wx_api_handler
target: production
registry: registry.cn-shanghai.aliyuncs.com
secrets: [docker_username, docker_password]
dockerfile: ./api/Dockerfile
scp_compose_yml:
group: build
image: appleboy/drone-scp
host: 115.159.222.199
secrets: [ssh_username, ssh_password]
port: 22
target:
- /home/ubuntu/wxapi/
- /home/ubuntu/wxapi/auth
source:
- ./docker-compose.yml
- ./micro.docker-compose.yml
ssh_compose_start:
image: appleboy/drone-ssh
host: 115.159.222.199
secrets: [ssh_username, ssh_password]
port: 22
script:
- sudo docker pull registry.cn-shanghai.aliyuncs.com/xugopher/wx_micro_auth
- sudo docker pull registry.cn-shanghai.aliyuncs.com/xugopher/wx_api_handler
- sudo docker network list -f name=internal | wc -l | awk '$0==1{cmd="sudo docker network create internal";system(cmd)}'
- sudo docker-compose -f /home/ubuntu/wxapi/docker-compose.yml down
- sudo docker-compose -f /home/ubuntu/wxapi/docker-compose.yml up -d
wechat_notification:
image: lizheming/drone-wechat
secrets: [wechat_corpid, wechat_corp_secret, wechat_agent_id, wechat_to_tag]
msg_url: ${DRONE_BUILD_LINK}
safe: 0
btn_txt: ok
title: ${DRONE_REPO_NAME}
message: >
{%if success %}
构建版本 {{build.number}} 成功. 开始测试业务流程吧.
{% else %}
构建版本 {{build.number}} 失败. 请查找一下问题所在.
{% endif %}
when:
status: [success, failure]