-
Notifications
You must be signed in to change notification settings - Fork 1
/
.drone-v1.yml
196 lines (187 loc) · 5.16 KB
/
.drone-v1.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
kind: pipeline
name: dq-jira
type: kubernetes
platform:
os: linux
arch: amd64
steps:
# - name: build_jira
# pull: if-not-exists
# image: plugins/docker
# settings:
# build_args:
# - JIRA_VERSION=8.7.1
# context: app/jira-docker
# dockerfile: app/jira-docker/Dockerfile
# force_tag: true
# registry: quay.io
# repo: quay.io/ukhomeofficedigital/jira-docker
# tags:
# - ${DRONE_COMMIT_SHA}
# - b${DRONE_BUILD_NUMBER}
# environment:
# DOCKER_PASSWORD:
# from_secret: docker_password
# DOCKER_USERNAME:
# from_secret: docker_username
# when:
# event:
# - push
#
# - name: trivy_scan_jira-docker
# pull: if-not-exists
# image: aquasec/trivy
# commands:
# - trivy --ignore-unfixed --exit-code 1 --no-progress quay.io/ukhomeofficedigital/jira-docker:${DRONE_COMMIT_SHA}
# when:
# branch:
# exclude:
# - master
# event:
# - push
#
# - name: build_jira_backup
# pull: if-not-exists
# image: plugins/docker
# settings:
# context: app/jira-s3-backup
# dockerfile: app/jira-s3-backup/Dockerfile
# registry: quay.io
# repo: quay.io/ukhomeofficedigital/dq-jira-s3-backup
# tags:
# - ${DRONE_COMMIT_SHA}
# - b${DRONE_BUILD_NUMBER}
# environment:
# DOCKER_PASSWORD:
# from_secret: docker_password
# DOCKER_USERNAME:
# from_secret: docker_username
# when:
# event:
# - push
#
# - name: trivy_scan_jira_backup
# pull: if-not-exists
# image: aquasec/trivy
# commands:
# - trivy --ignore-unfixed --exit-code 1 --no-progress quay.io/ukhomeofficedigital/dq-jira-s3-backup:${DRONE_COMMIT_SHA}
# when:
# branch:
# exclude:
# - master
# event:
# - push
# - name: build_access_log
# pull: if-not-exists
# image: plugins/docker
# settings:
# context: app/jira-logger
# dockerfile: app/jira-logger/Dockerfile
# registry: quay.io
# repo: quay.io/ukhomeofficedigital/dq-logger
# tags:
# - ${DRONE_COMMIT_SHA}
# - b${DRONE_BUILD_NUMBER}
# environment:
# DOCKER_PASSWORD:
# from_secret: docker_password
# DOCKER_USERNAME:
# from_secret: docker_username
# when:
# event:
# - push
#
# - name: trivy_scan_logger
# pull: if-not-exists
# image: aquasec/trivy
# commands:
# - trivy --ignore-unfixed --exit-code 1 --no-progress quay.io/ukhomeofficedigital/dq-logger:${DRONE_COMMIT_SHA}
# when:
# branch:
# exclude:
# - master
# event:
# - push
- name: deploy_to_dev
pull: if-not-exists
image: quay.io/ukhomeofficedigital/kd
commands:
- export KUBE_TOKEN=$$NOTPROD_KUBE_TOKEN
- export KUBE_SERVER=$$NOTPROD_KUBE_SERVER
- export BUCKET_NAME=$$NOTPROD_BUCKET_NAME
- export ACCESS_KEY_ID=$$NOTPROD_ACCESS_KEY_ID
- export SECRET_ACCESS_KEY=$$NOTPROD_SECRET_ACCESS_KEY
- export SLACK_WEBHOOK=$$NOTPROD_SLACK_WEBHOOK
- kd --delete -f deployment.yml
- kd -f network-policy.yml -f pvc.yml -f service.yml -f ingress.yml -f secrets.yml -f deployment.yml
environment:
AWS_BUCKET_SECRET_NAME: s3-dq-notprod-management-jira-backup
DATABASE_SCHEMA_NAME: public
DATABASE_SECRET_NAME: dq-jira-notprod-rds-access
ENV: notprod
HOSTNAME: jira.notprod.dq.homeoffice.gov.uk
INSECURE_SKIP_TLS_VERIFY: true
JIRA_HOME_VOLUME_SIZE: 10Gi
JIRA_VERSION: 8.7.1
KUBE_NAMESPACE: dq-management-notprod
NOTPROD_ACCESS_KEY_ID:
from_secret: NOTPROD_ACCESS_KEY_ID
NOTPROD_BUCKET_NAME:
from_secret: NOTPROD_BUCKET_NAME
NOTPROD_KUBE_SERVER:
from_secret: NOTPROD_KUBE_SERVER
NOTPROD_KUBE_TOKEN:
from_secret: NOTPROD_KUBE_TOKEN
NOTPROD_SECRET_ACCESS_KEY:
from_secret: NOTPROD_SECRET_ACCESS_KEY
NOTPROD_SLACK_WEBHOOK:
from_secret: NOTPROD_SLACK_WEBHOOK
when:
event:
- push
- name: deploy_to_prod
pull: if-not-exists
image: quay.io/ukhomeofficedigital/kd
commands:
- export KUBE_TOKEN=$$PROD_KUBE_TOKEN
- export KUBE_SERVER=$$PROD_KUBE_SERVER
- export BUCKET_NAME=$$PROD_BUCKET_NAME
- export ACCESS_KEY_ID=$$PROD_ACCESS_KEY_ID
- export SECRET_ACCESS_KEY=$$PROD_SECRET_ACCESS_KEY
- export SLACK_WEBHOOK=$$PROD_SLACK_WEBHOOK
- kd --delete -f deployment.yml
- kd -f network-policy.yml -f pvc.yml -f service.yml -f ingress.yml -f secrets.yml -f deployment.yml
environment:
AWS_BUCKET_SECRET_NAME: s3-dq-management-jira-backup
DATABASE_SCHEMA_NAME: public
# DATABASE_SECRET_NAME: dq-jira-rds-access-2
DATABASE_SECRET_NAME: dq-management-jira-rds-access
ENV: prod
HOSTNAME: jira.dq.homeoffice.gov.uk
INSECURE_SKIP_TLS_VERIFY: true
JIRA_HOME_VOLUME_SIZE: 25Gi
JIRA_VERSION: 8.7.1
KUBE_NAMESPACE: dq-management
PROD_ACCESS_KEY_ID:
from_secret: PROD_ACCESS_KEY_ID
PROD_BUCKET_NAME:
from_secret: PROD_BUCKET_NAME
PROD_KUBE_SERVER:
from_secret: PROD_KUBE_SERVER
PROD_KUBE_TOKEN:
from_secret: PROD_KUBE_TOKEN
PROD_SECRET_ACCESS_KEY:
from_secret: PROD_SECRET_ACCESS_KEY
PROD_SLACK_WEBHOOK:
from_secret: PROD_SLACK_WEBHOOK
when:
branch:
- master
event:
- promote
target:
- production
services:
- name: docker
image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/dind