forked from UKHomeOffice/hocs-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
123 lines (112 loc) · 3.54 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
120
121
122
123
pipeline:
build-docker-image:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -t hocs-frontend .
when:
branch: master
event: push
install-docker-image:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
secrets:
- docker_password
commands:
- docker login -u="ukhomeofficedigital+hocs" -p=$${DOCKER_PASSWORD} quay.io
- docker tag hocs-frontend quay.io/ukhomeofficedigital/hocs-frontend:build-$${DRONE_BUILD_NUMBER}
- docker tag hocs-frontend quay.io/ukhomeofficedigital/hocs-frontend:latest
- docker push quay.io/ukhomeofficedigital/hocs-frontend:build-$${DRONE_BUILD_NUMBER}
- docker push quay.io/ukhomeofficedigital/hocs-frontend:latest
when:
branch: master
event: push
sonar-scanner:
image: quay.io/ukhomeofficedigital/sonar-scanner:v3.0.2
when:
event: [push, pull_request, tag]
docker-semver-tag:
image: quay.io/ukhomeofficedigital/hocs-version-bot:build-25
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
- DOCKER_API_VERSION=1.37
secrets:
- github_password
- docker_password
- git_password
commands:
- /app/hocs-deploy --version=$${SEMVER} --serviceGitToken=$${GIT_PASSWORD} --service=hocs-frontend --gitToken=$${GITHUB_PASSWORD} --gitRepo="https://gitlab.digital.homeoffice.gov.uk/hocs/hocs-versions.git" --environment=qa --dockerRepository=quay.io/ukhomeofficedigital --sourceBuild=$${IMAGE_VERSION} --registryUser=ukhomeofficedigital+hocs --registryPassword=$${DOCKER_PASSWORD}
when:
event: deployment
environment: qa
clone-kube-project:
image: plugins/git
commands:
- git clone https://github.com/UKHomeOffice/kube-hocs-frontend.git
when:
event: [push, deployment, tag]
deploy-to-dev-from-build-number:
image: quay.io/ukhomeofficedigital/kd:v1.12.2
environment:
- KUBE_NAMESPACE=cs-dev
- ENVIRONMENT=dev
- VERSION=build-${DRONE_BUILD_NUMBER}
- KUBE_SERVER=https://kube-api-notprod.notprod.acp.homeoffice.gov.uk
secrets:
- hocs_frontend_dev
commands:
- cd kube-hocs-frontend
- ./deploy.sh
when:
branch: master
event: [push, tag]
deployment:
image: quay.io/ukhomeofficedigital/kd:v1.12.2
environment:
- KUBE_NAMESPACE=cs-${DRONE_DEPLOY_TO}
- ENVIRONMENT=${DRONE_DEPLOY_TO}
- KUBE_SERVER=https://kube-api-notprod.notprod.acp.homeoffice.gov.uk
secrets:
- hocs_frontend_dev
- hocs_frontend_demo
- poise_whitelist
commands:
- cd kube-hocs-frontend
- ./deploy.sh
when:
event: deployment
environment: [dev, demo]
deploy-to-qa:
image: quay.io/ukhomeofficedigital/kd:v1.12.1
environment:
- KUBE_NAMESPACE=cs-qa
- ENVIRONMENT=qa
- KUBE_SERVER=https://kube-api-notprod.notprod.acp.homeoffice.gov.uk
secrets:
- hocs_frontend_qa
- poise_whitelist
commands:
- source version.txt
- echo $VERSION
- cd kube-hocs-frontend
- ./deploy.sh
when:
event: deployment
environment: qa
deploy-to-prod:
image: quay.io/ukhomeofficedigital/kd:v1.12.2
environment:
- KUBE_NAMESPACE=cs-prod
- ENVIRONMENT=prod
- KUBE_SERVER=https://kube-api-prod.prod.acp.homeoffice.gov.uk
secrets:
- hocs_frontend_prod
- poise_whitelist
commands:
- cd kube-hocs-frontend
- ./deploy.sh
when:
event: deployment
environment: prod