-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
113 lines (111 loc) · 2.8 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
kind: pipeline
type: kubernetes
name: default
helm_deploy: &helm_deploy
mode: upgrade
wait_for_upgrade: true
atomic: true
cleanup_failed_upgrade: true
reuse_values: true
kube_api_server: https://kubernetes.default
kube_certificate:
from_secret: kube_certificate
client_certificate_data:
from_secret: client_certificate_data
client_key_data:
from_secret: client_key_data
steps:
# BUILD OCI IMAGE
- name: docker
image: harbor.v2.dcas.dev/library/drone-kaniko
settings:
registry: harbor.v2.dcas.dev
repo: dcas.dev/fav2
tags:
- latest
- ${DRONE_BRANCH/\//-}
- ${DRONE_COMMIT_SHA}
authjson_docker:
from_secret: DOCKER_AUTH
# LINT HELM CHART
- name: helm_lint
image: harbor.v2.dcas.dev/djcass44/drone-helm3
settings:
mode: lint
chart: ./fav-helm
# DEPLOY TO DEV
- name: deploy_development
image: harbor.v2.dcas.dev/djcass44/drone-helm3
depends_on:
- helm_lint
- docker
- deploy_dev_redis
settings:
<<: *helm_deploy
namespace: development
release: fav2
chart: ./fav-helm
values:
- ingress.enabled=true
- ingress.host=icon-dev.v2.dcas.dev
- image.tag=${DRONE_COMMIT_SHA}
- spring.profile=development
when:
branch:
exclude: master
- name: deploy_dev_redis
image: harbor.v2.dcas.dev/djcass44/drone-helm3
settings:
<<: *helm_deploy
namespace: development
add_repos: ["bitnami=https://charts.bitnami.com/bitnami"]
release: fav2-redis
chart: bitnami/redis
values:
- cluster.enabled=false
- master.persistence.enabled=false
- slave.persistence.enabled=false
- usePassword=false
when:
branch:
exclude: master
# DEPLOY TO PROD
- name: deploy_production
image: harbor.v2.dcas.dev/djcass44/drone-helm3
depends_on:
- helm_lint
- docker
- deploy_prod_redis
settings:
<<: *helm_deploy
namespace: production
release: fav2
chart: ./fav-helm
values:
- ingress.enabled=true
- ingress.host=icon.v2.dcas.dev
- image.tag=${DRONE_BRANCH}
- spring.profile=production
- resources.requests.memory=250Mi
- resources.limits.memory=500Mi
when:
branch:
- master
- name: deploy_prod_redis
image: harbor.v2.dcas.dev/djcass44/drone-helm3
settings:
<<: *helm_deploy
namespace: production
add_repos: ["bitnami=https://charts.bitnami.com/bitnami"]
release: fav2-redis
chart: bitnami/redis
values:
- master.persistence.storageClass=nfs
- slave.persistence.storageClass=nfs
- usePassword=false
when:
branch:
- master
trigger:
when:
event: push