-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
78 lines (67 loc) · 1.51 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
69
70
71
72
73
74
kind: pipeline
type: docker
name: kube-alert
platform:
os: linux
arch: amd64
steps:
- name: 编译Build
image: golang:1.13.4
commands:
- go test
- go build -o kube-alert
volumes:
- name: gopath
path: /go
environment:
GOPROXY: https://goproxy.cn,direct
GOSUMDB: sum.golang.google.cn
GOPRIVATE: gitcodecloud.lenovo.com.cn
CGO_ENABLED: "0"
- name: 构建镜像
image: plugins/docker
volumes:
- name: docker
path: /var/run/docker.sock
settings:
username:
from_secret: docker_user
password:
from_secret: docker_pass
repo: registry.cn-beijing.aliyuncs.com/octopus-tool/kube-alert
registry: registry.cn-beijing.aliyuncs.com
tags: ${DRONE_BUILD_NUMBER}
- name: Kubernetes 部署
image: guoxudongdocker/kubectl:v1.14.1
volumes:
- name: kube
path: /root/.kube
commands:
- sed -i "s/#Tag/${DRONE_BUILD_NUMBER}/g" job.yml
- kubectl apply -f job.yml
when:
status: [failure, success]
- name: 钉钉通知
image: guoxudongdocker/drone-dingtalk
settings:
token:
from_secret: dingding
type: markdown
message_color: true
message_pic: true
sha_link: true
when:
status: [failure, success]
volumes:
- name: kube
host:
path: /root/drone/kube
- name: docker
host:
path: /var/run/docker.sock
- name: gopath
host:
path: /root/drone/gopath
trigger:
branch:
- master