-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
87 lines (80 loc) · 2.26 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
75
76
77
78
79
80
81
82
83
84
85
86
87
kind: pipeline
type: kubernetes
name: demo
steps:
# - name: linter
# image: hub.alin.app/library/golang:1.15.0-alpine3.12
# environment:
# GOPROXY: https://mirrors.aliyun.com/goproxy/
# commands:
# - go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
# - golangci-lint run
# - name: test
# image: hub.alin.app/library/golang:1.15.0-alpine3.12
# environment:
# GOPROXY: https://mirrors.aliyun.com/goproxy/
# volumes:
# - name: temp
# path: /go
# commands:
# - go test
- name: publish
image: hub.alin.app/plugins/docker:18.09.2
network_mode: bridge
settings:
purge: false
debug: true
# insecure: true
registry: hub.alin.app
repo: hub.alin.app/library/demo
# cache_from: hub.alin.app/library/demo
# mirror: https://registry.docker-cn.com # 国内镜像
# build_args:
# - HTTP_PROXY=http://yourproxy.com # http代理
tags: ${DRONE_TAG=latest}
target: production
dockerfile: Dockerfile # dockerfile to be used, defaults to Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: deploy
image: hub.alin.app/plugins/drone-plugin-kube:0.2.0
settings:
build_name: demo
build_tag: ${DRONE_TAG=latest}
template: ./deployment.yml # relative to repo root
server:
from_secret: k8s_server # K8S master node address
ca:
from_secret: k8s_cert # BASE64 encoded string of the K8S CA cert /etc/kubernetes/pki/ca.crt
token:
from_secret: k8s_token # Service account token to a service account that can manage deployments
- name: notify
image: hub.alin.app/plugins/drone-email:latest
host: smtp.163.com
# skip_verify: true # skip SMTP server certificate verification
username:
from_secret: email_username
password:
from_secret: email_password
from:
from_secret: email_username
recipients_only: true # 只发给接收人
recipients: [ [email protected], [email protected] ] # 接收人
# attachment: build-result.xml # 附件
when:
status: [ changed, failure ]
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
trigger:
event:
include:
- tag
- push
- pull_request