forked from uber/baseweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
130 lines (123 loc) · 2.96 KB
/
docker-compose.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
version: '2.3'
services:
# to run selenium with chrome locally
chrome-standalone:
image: selenium/standalone-chrome:latest@sha256:0d1847a44c5e21df5891426dd1c054d4a3b51d0688791903f809bddd76595e65
network_mode: 'host'
restart: always
ports:
- '4444:4444'
e2e-test-chrome:
build: .
network_mode: 'host'
depends_on:
- chrome-standalone
- e2e-server-healthy
command: yarn e2e:test
environment:
- CODECOV_TOKEN
- CI=true
- BUILDKITE
- BUILDKITE_BRANCH
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_URL
- BUILDKITE_PROJECT_SLUG
- BUILDKITE_COMMIT
- SELENIUM_REMOTE_URL=http://localhost:4444/wd/hub
# so tests can run against localhost
sauce-tunnel:
image: henrrich/docker-sauce-connect:latest@sha256:9921657d1a3db8832f868ab25491363756abae52025a8d5af888aadc42ed31e9
restart: always
expose:
- 4445
ports:
- 4445
network_mode: 'host'
command:
[
'-u',
'${SAUCE_USERNAME}',
'-k',
'${SAUCE_ACCESS_KEY}',
'-i',
'${BUILDKITE_BUILD_NUMBER}',
'-p',
]
environment:
- SAUCE_USERNAME
- SAUCE_ACCESS_KEY
- BUILDKITE_BUILD_NUMBER
healthcheck:
test:
[
'CMD-SHELL',
'grep -R "Sauce Connect is up" /tmp/sc-${BUILDKITE_BUILD_NUMBER}.log || exit 1',
]
interval: 5s
timeout: 5m
retries: 10
start_period: 30s
# docker-compose run does not wait on healthchecks, so proxy using this service
sauce-tunnel-healthy:
build: .
network_mode: 'host'
depends_on:
sauce-tunnel:
condition: service_healthy
# this spins up a server that serves the html/js/css for the e2e tests
e2e-server:
build: .
command: yarn e2e:serve
expose:
- 8080
ports:
- '8080:8080'
healthcheck:
test:
[
'CMD-SHELL',
'curl -H "Accept: text/html" -f http://localhost:8080 || exit 1',
]
interval: 5s
timeout: 10s
retries: 5
# tests if the e2e-server is ready to serve traffic
e2e-server-healthy:
build: .
network_mode: 'host'
depends_on:
e2e-server:
condition: service_healthy
# running the e2e tests in ci
e2e-test:
build: .
network_mode: 'host'
depends_on:
- e2e-server-healthy
- sauce-tunnel-healthy
environment:
- CODECOV_TOKEN
- CI=true
- BUILDKITE
- BUILDKITE_BRANCH
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_URL
- BUILDKITE_PROJECT_SLUG
- BUILDKITE_COMMIT
- SAUCE_USERNAME
- SAUCE_ACCESS_KEY
baseui:
build: .
environment:
- CODECOV_TOKEN
- CI=true
- BUILDKITE
- BUILDKITE_BRANCH
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_JOB_ID
- BUILDKITE_BUILD_URL
- BUILDKITE_PROJECT_SLUG
- BUILDKITE_COMMIT
- SCREENER_API_KEY