-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.drone.yml
37 lines (34 loc) · 1.21 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
kind: pipeline
type: docker
name: yearendproject
trigger:
ref:
- refs/tags/release-*
clone:
depth: 1
steps:
- name: build-and-push-image # 构建 golang 镜像
image: plugins/docker
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/year_end_project_backend #要推送docker地址
registry: registry-vpc.cn-shenzhen.aliyuncs.com # 使用的docker hub地址
tags: ${DRONE_TAG}
- 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