-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.drone.yml
More file actions
97 lines (93 loc) · 3.62 KB
/
.drone.yml
File metadata and controls
97 lines (93 loc) · 3.62 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
kind: pipeline
type: docker
name: forum-be
trigger:
ref:
- refs/tags/release-*
clone:
depth: 1
steps:
- name: build user service image # 构建 user 服务镜像
image: plugins/docker
when:
ref:
- refs/tags/release-user-*
volumes:
- name: dockersock # 挂载下面定义的Volumn
path: /var/run/docker.sock # 与宿主机用同一docker
settings: # plugins/docker用到的相关配置
username:
from_secret: docker_user # alicloud指定的docker hub的用户名(前面配置)
password:
from_secret: docker_password # alicloud指定的docker hub的密码(前面配置)
repo: registry-vpc.cn-shenzhen.aliyuncs.com/muxi/forum_be_user #要推送docker地址
registry: registry-vpc.cn-shenzhen.aliyuncs.com # 使用的docker hub地址
tags: ${DRONE_TAG}
build_args:
- service_name=user
- name: build gateway service image # 构建 gateway 服务镜像
image: plugins/docker
when:
ref:
- refs/tags/release-gateway-*
volumes:
- name: dockersock # 挂载下面定义的Volumn
path: /var/run/docker.sock # 与宿主机用同一docker
settings: # plugins/docker用到的相关配置
username:
from_secret: docker_user # alicloud指定的docker hub的用户名(前面配置)
password:
from_secret: docker_password # alicloud指定的docker hub的密码(前面配置)
repo: registry-vpc.cn-shenzhen.aliyuncs.com/muxi/forum_be_gateway #要推送docker地址
registry: registry-vpc.cn-shenzhen.aliyuncs.com # 使用的docker hub地址
tags: ${DRONE_TAG}
build_args:
- service_name=gateway
- name: build post service image # 构建 post 服务镜像
image: plugins/docker
when:
ref:
- refs/tags/release-post-*
volumes:
- name: dockersock # 挂载下面定义的Volumn
path: /var/run/docker.sock # 与宿主机用同一docker
settings: # plugins/docker用到的相关配置
username:
from_secret: docker_user # alicloud指定的docker hub的用户名(前面配置)
password:
from_secret: docker_password # alicloud指定的docker hub的密码(前面配置)
repo: registry-vpc.cn-shenzhen.aliyuncs.com/muxi/forum_be_post #要推送docker地址
registry: registry-vpc.cn-shenzhen.aliyuncs.com # 使用的docker hub地址
tags: ${DRONE_TAG}
build_args:
- service_name=post
- name: build chat service image # 构建 chat 服务镜像
image: plugins/docker
when:
ref:
- refs/tags/release-chat-*
volumes:
- name: dockersock # 挂载下面定义的Volumn
path: /var/run/docker.sock # 与宿主机用同一docker
settings: # plugins/docker用到的相关配置
username:
from_secret: docker_user # alicloud指定的docker hub的用户名(前面配置)
password:
from_secret: docker_password # alicloud指定的docker hub的密码(前面配置)
repo: registry-vpc.cn-shenzhen.aliyuncs.com/muxi/forum_be_chat #要推送docker地址
registry: registry-vpc.cn-shenzhen.aliyuncs.com # 使用的docker hub地址
tags: ${DRONE_TAG}
build_args:
- service_name=chat
# - name: send remind
# image: golang
# when:
# status:
# - success
# - failure
# commands:
# - curl -X POST 'http://47.97.74.180:1217/bot/remind?build_status=${DRONE_BUILD_STATUS}&author=${DRONE_COMMIT_AUTHOR}&repo=${DRONE_REPO}&host=${DRONE_SYSTEM_HOST}&repo_link=${DRONE_REPO_LINK}&tag=${DRONE_TAG}&failed_steps=${DRONE_FAILED_STEPS}'
volumes:
- name: dockersock
host:
path: /var/run/docker.sock