-
Notifications
You must be signed in to change notification settings - Fork 45
/
.drone.yml
96 lines (88 loc) · 2.1 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
88
89
90
91
92
93
94
95
96
kind: pipeline
name: default
workspace:
base: /go
path: src/github.com/fanux/fist/
steps:
- name: build-fist
image: golang:1.12
environment:
GO111MODULE: on
commands:
- go get -u golang.org/x/lint/golint
- golint -set_exit_status auth namespace rbac tools cmd template terminal
- go build -o fist
- name: tryrun-fist
image: golang:1.10.8
commands:
- ./fist auth -h
- ./fist terminal -h
- ./fist rbac -h
- name: publish-fist
image: plugins/docker
settings:
repo: lameleg/fist
tags: ${DRONE_TAG=latest}
username:
from_secret: docker-hub-user
dockerfile: deploy/Dockerfile
password:
from_secret: docker-hub-pass
when:
event:
- push
- name: deploy-template
image: cuisongliu/drone-kube
settings:
template_repo: lameleg/fist
template_tags: ${DRONE_TAG=latest}
commands:
- drone-kube template --deploy=deploy/template
when:
event:
- push
- name: deploy-uninstall
image: cuisongliu/drone-kube
settings:
kube_server:
from_secret: k8s-server
kube_ca:
from_secret: k8s-ca
kube_admin:
from_secret: k8s-admin
kube_admin_key:
from_secret: k8s-admin-key
commands:
- drone-kube config
- kubectl delete -f deploy/template || true
- sleep 5
when:
event:
- push
- name: deploy-install
image: cuisongliu/drone-kube
settings:
kube_server:
from_secret: k8s-server
kube_ca:
from_secret: k8s-ca
kube_admin:
from_secret: k8s-admin
kube_admin_key:
from_secret: k8s-admin-key
commands:
- mkdir ~/.kube
- cp deploy/config ~/.kube/config
- kubectl delete -f rbac/deploy/deploy.yaml || true
- kubectl delete -f rbac/deploy/secret.yaml || true
- sleep 15
- kubectl create -f rbac/deploy/secret.yaml || true
- kubectl create -f rbac/deploy/deploy.yaml || true
- name: deploy-templates
image: lachlanevenson/k8s-kubectl
commands:
- mkdir ~/.kube
- cp deploy/config ~/.kube/config
- kubectl delete -f template/deploy/deploy.yaml || true
- sleep 15
- kubectl create -f template/deploy/deploy.yaml || true