-
Notifications
You must be signed in to change notification settings - Fork 16
/
.drone.yml
119 lines (111 loc) · 2.59 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
kind: pipeline
name: deploy
steps:
- name: pre-check
image: docker
environment:
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
MY_TELEGRAM_TOKEN:
from_secret: MY_TELEGRAM_TOKEN
MY_TELEGRAM_ID:
from_secret: MY_TELEGRAM_ID
GITHUB_TOKEN:
from_secret: GITHUB_TOKEN
commands:
- echo $${DOCKER_PASSWORD}
- echo $${MY_TELEGRAM_TOKEN}
- echo $${MY_TELEGRAM_ID}
- echo $${GITHUB_TOKEN}
- name: unit-test
image: node:10
commands:
- node test/index.js
when:
branch:
include:
- feature/*
- master
- dev
event:
include:
- push
- pull_request
- name: build-branch-image
image: plugins/docker
settings:
repo: allovince/drone-ci-demo
username: allovince
password:
from_secret: DOCKER_PASSWORD
tag:
- ${DRONE_BRANCH##feature/}
when:
branch: feature/*
event: push
- name: build-test-image
image: plugins/docker
settings:
repo: allovince/drone-ci-demo
username: allovince
password:
from_secret: DOCKER_PASSWORD
tag:
- test
when:
branch: dev
event: push
- name: build-staging-image
image: plugins/docker
settings:
repo: allovince/drone-ci-demo
username: allovince
password:
from_secret: DOCKER_PASSWORD
tag:
- latest
when:
branch: master
event: pull_request
- name: semantic-release
image: gtramontina/semantic-release:15.13.3
environment:
GITHUB_TOKEN:
from_secret: GITHUB_TOKEN
entrypoint:
- semantic-release
when:
branch: master
event: push
- name: build-production-image
image: plugins/docker
settings:
repo: allovince/drone-ci-demo
username: allovince
password:
from_secret: DOCKER_PASSWORD
tag:
- ${DRONE_TAG}
when:
event: tag
- name: k8s-deploy
image: quay.io/honestbee/drone-kubernetes
settings:
kubernetes_server:
from_secret: KUBERNETES_SERVER
kubernetes_cert:
from_secret: KUBERNETES_CERT
kubernetes_token:
from_secret: KUBERNETES_TOKEN
namespace: default
deployment: ci-demo-deployment
repo: allovince/drone-ci-demo
container: ci-demo
tag:
- ${DRONE_TAG}
# remove commands in real production env
commands:
- echo "kubectl -n default set image deployment/ci-demo-deployment ci-demo=allovince/drone-ci-demo:${DRONE_TAG}"
when:
event: tag