-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
129 lines (118 loc) · 4.4 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
124
125
126
127
128
129
pipeline:
build_10:
image: node:10
commands:
- npm --loglevel warn install
- npm run test
when:
event: [push, pull_request]
build_app:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -t app-$${DRONE_COMMIT_SHA} .
when:
event: pull_request
build_app:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -t app-$${DRONE_COMMIT_SHA} .
when:
branch: master
event: push
build_acceptance:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -f Dockerfile-acceptance -t acceptance-$${DRONE_COMMIT_SHA} .
when:
event: pull_request
build_acceptance:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker build -f Dockerfile-acceptance -t acceptance-$${DRONE_COMMIT_SHA} .
when:
branch: master
event: push
test_acceptance:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker run -d --name=redis-$${DRONE_COMMIT_SHA} redis
- docker run -d -e NODE_ENV=ci -e DISABLE_CSP=true -e EMAIL_TRANSPORT=stub -e [email protected] --net=container:redis-$${DRONE_COMMIT_SHA} --name=app-$${DRONE_COMMIT_SHA} app-$${DRONE_COMMIT_SHA}
- docker run -d --net=container:app-$${DRONE_COMMIT_SHA} --name=selenium-$${DRONE_COMMIT_SHA} selenium/standalone-chrome
- sleep 5
- docker run --rm -e NODE_ENV=ci -e DISABLE_CSP=true -e EMAIL_TRANSPORT=stub -e [email protected] --net=container:app-$${DRONE_COMMIT_SHA} acceptance-$${DRONE_COMMIT_SHA}
- docker rm -vf "app-$${DRONE_COMMIT_SHA}" "redis-$${DRONE_COMMIT_SHA}" "selenium-$${DRONE_COMMIT_SHA}"
when:
event: pull_request
test_acceptance:
image: docker:17.09.1
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker run -d --name=redis-$${DRONE_COMMIT_SHA} redis
- docker run -d -e NODE_ENV=ci -e DISABLE_CSP=true -e EMAIL_TRANSPORT=stub -e [email protected] --net=container:redis-$${DRONE_COMMIT_SHA} --name=app-$${DRONE_COMMIT_SHA} app-$${DRONE_COMMIT_SHA}
- docker run -d --net=container:app-$${DRONE_COMMIT_SHA} --name=selenium-$${DRONE_COMMIT_SHA} selenium/standalone-chrome
- sleep 5
- docker run --rm -e NODE_ENV=ci -e DISABLE_CSP=true -e EMAIL_TRANSPORT=stub -e [email protected] --net=container:app-$${DRONE_COMMIT_SHA} acceptance-$${DRONE_COMMIT_SHA}
- docker rm -vf "app-$${DRONE_COMMIT_SHA}" "redis-$${DRONE_COMMIT_SHA}" "selenium-$${DRONE_COMMIT_SHA}"
when:
branch: master
event: push
image_to_quay:
image: docker:17.09.1
secrets:
- DOCKER_PASSWORD
environment:
- DOCKER_HOST=tcp://172.17.0.1:2375
commands:
- docker login -u="ukhomeofficedigital+drone" -p=$${DOCKER_PASSWORD} quay.io
- docker tag app-$${DRONE_COMMIT_SHA} quay.io/ukhomeofficedigital/rent-check:$${DRONE_COMMIT_SHA}
- docker push quay.io/ukhomeofficedigital/rent-check:$${DRONE_COMMIT_SHA}
when:
branch: master
event: push
trigger_deploy_to_rent-check_dev:
image: quay.io/ukhomeofficedigital/drone-trigger:v0.3.0
secrets:
- DRONE_TOKEN
drone_server: https://drone.acp.homeoffice.gov.uk
repo: UKHomeOffice/kube-right-to-rent
branch: master
deploy_to: dev
params: APP_IMAGE_TAG=${DRONE_COMMIT_SHA},KUBE_NAMESPACE=rent-check-dev
when:
branch: master
event: push
trigger_deploy_to_rent-check_preprod:
image: quay.io/ukhomeofficedigital/drone-trigger:v0.3.0
secrets:
- DRONE_TOKEN
drone_server: https://drone.acp.homeoffice.gov.uk
repo: UKHomeOffice/kube-right-to-rent
branch: master
deploy_to: preprod
params: APP_IMAGE_TAG=${DRONE_COMMIT_SHA},KUBE_NAMESPACE=rent-check-preprod
when:
event: deployment
environment: preprod
trigger_deploy_to_rent-check_prod:
image: quay.io/ukhomeofficedigital/drone-trigger:v0.3.0
secrets:
- DRONE_TOKEN
drone_server: https://drone.acp.homeoffice.gov.uk
repo: UKHomeOffice/kube-right-to-rent
branch: master
deploy_to: prod
params: APP_IMAGE_TAG=${DRONE_COMMIT_SHA},KUBE_NAMESPACE=rent-check
when:
event: deployment
environment: prod