-
Notifications
You must be signed in to change notification settings - Fork 22
/
.drone.yml
107 lines (97 loc) · 2.34 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
---
kind: pipeline
type: kubernetes
name: default
trigger:
branch:
- master
event:
- push
platform:
os: linux
arch: amd64
steps:
- name: deploy
pull: if-not-exists
image: node:18-alpine
commands:
- apk add -q --no-cache docker git jq make
- echo "$${DOCKER_PASSWORD}" | docker login -u "$${DOCKER_USERNAME}" --password-stdin "$${DOCKER_REGISTRY}"
- npm install -g [email protected]
- wget -q "https://storage.googleapis.com/kubernetes-release/release/v$${KUBECTL_VERSION}/bin/linux/amd64/kubectl" -O "/usr/bin/kubectl"
- chmod +x "/usr/bin/kubectl"
- cd 'apps/docs'
- make deploy kubectl="kubectl --insecure-skip-tls-verify --server=$${KUBE_SERVER} --namespace=$${KUBE_NAMESPACE} --token=$${KUBE_TOKEN}"
environment:
DOCKER_HOST: tcp://127.0.0.1:2375
DOCKER_REGISTRY: quay.io
DOCKER_USERNAME: ukhomeofficedigital+design_system
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
KUBE_CONTAINER:
from_secret: KUBE_CONTAINER
KUBE_DEPLOYMENT:
from_secret: KUBE_DEPLOYMENT
KUBE_NAMESPACE:
from_secret: KUBE_NAMESPACE
KUBE_SERVER:
from_secret: KUBE_SERVER
KUBE_TOKEN:
from_secret: KUBE_TOKEN
KUBECTL_VERSION: 1.19.15
NODE_OPTIONS: --max_old_space_size=4096
when:
branch:
- master
event:
- push
resources:
requests:
cpu: 500
memory: 5GiB
limits:
cpu: 4000
memory: 5GiB
- name: notify_slack_success
pull: if-not-exists
image: plugins/slack
settings:
channel: ho-design-system
template: >
*{{build.author}} deployed {{repo.name}}* - <{{build.link}}|#{{build.number}}>
username: Drone
environment:
SLACK_WEBHOOK:
from_secret: slack_webhook
when:
branch:
- master
event:
- push
status:
- success
- name: notify_slack_failure
pull: if-not-exists
image: plugins/slack
settings:
channel: ho-design-system
template: >
*Failed to deploy {{repo.name}}*
Job: <{{build.link}}|#{{build.number}}>
Duration: {{since job.started}}
Commit: {{build.commit}}
Author: {{build.author}}
username: Drone
environment:
SLACK_WEBHOOK:
from_secret: slack_webhook
when:
branch:
- master
event:
- push
status:
- failure
services:
- name: docker
image: 340268328991.dkr.ecr.eu-west-2.amazonaws.com/acp/dind