-
Notifications
You must be signed in to change notification settings - Fork 372
/
Copy pathdocker-compose.yml
146 lines (129 loc) · 4.36 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
version: '3.4'
# Environment variables that will be exposed to every Cypress runner.
x-e2e-env:
&default-env
# CI build information for Cypress Dashboard.
BUILD_ID: "${GIT_BRANCH}-${BUILD_NUMBER}"
BUILD_NUMBER: ${BUILD_NUMBER}
BUILD_URL: ${BUILD_URL}
# Exposing `COMMIT_INFO_*` environment variables to Cypress allows us to
# manually specify git commit information. This is required because Cypress
# cannot retrieve the information automatically from within the container due
# to file ownership differences.
#
# See also:
# - https://github.com/cypress-io/commit-info
# - https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks
COMMIT_INFO_AUTHOR: ${COMMIT_INFO_AUTHOR}
COMMIT_INFO_BRANCH: ${CHANGE_BRANCH}
COMMIT_INFO_EMAIL: ${COMMIT_INFO_EMAIL}
COMMIT_INFO_MESSAGE: ${COMMIT_INFO_MESSAGE}
COMMIT_INFO_REMOTE: ${GIT_URL}
COMMIT_INFO_SHA: ${GIT_COMMIT}
# Cypress environment variables for run environment and CI configuration.
CYPRESS_BASE_URL: ${CYPRESS_BASE_URL}
CYPRESS_PULL_REQUEST_ID: ${CHANGE_ID}
CYPRESS_PULL_REQUEST_URL: ${CHANGE_URL}
CYPRESS_RECORD: ${CYPRESS_RECORD}
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
# Cloud Manager-specific test configuration.
CY_TEST_SUITE: ${CY_TEST_SUITE}
CY_TEST_REGION: ${CY_TEST_REGION}
# Cypress environment variables for alternative parallelization.
CY_TEST_SPLIT_RUN: ${CY_TEST_SPLIT_RUN}
CY_TEST_SPLIT_RUN_TOTAL: ${CY_TEST_SPLIT_RUN_TOTAL}
CY_TEST_SPLIT_RUN_INDEX: ${CY_TEST_SPLIT_RUN_INDEX}
# Cypress reporting.
CY_TEST_JUNIT_REPORT: ${CY_TEST_JUNIT_REPORT}
CY_TEST_USER_REPORT: ${CY_TEST_USER_REPORT}
# Cloud Manager build environment.
HOME: /home/node
REACT_APP_API_ROOT: ${REACT_APP_API_ROOT}
REACT_APP_CLIENT_ID: ${REACT_APP_CLIENT_ID}
REACT_APP_DISABLE_NEW_RELIC: ${REACT_APP_DISABLE_NEW_RELIC}
REACT_APP_LAUNCH_DARKLY_ID: ${REACT_APP_LAUNCH_DARKLY_ID}
REACT_APP_LOGIN_ROOT: ${REACT_APP_LOGIN_ROOT}
# Miscellaneous Jenkins vars.
HUDSON_HOME: ${HUDSON_HOME}
HUDSON_URL: ${HUDSON_URL}
# Volumes that will be exposed to every end-to-end Cypress runner.
x-e2e-volumes:
&default-volumes
- ./.git:/home/node/app/.git
- ./packages/manager:/home/node/app/packages/manager
- ./packages/validation:/home/node/app/packages/validation
- ./packages/api-v4:/home/node/app/packages/api-v4
- ./package.json:/home/node/app/package.json
- ./node_modules:/home/node/app/node_modules
# Base Docker Compose service config for each Cypress runner.
# This can be extended/overridden on a per-runner basis for e.g.container name
# and OAuth token.
x-e2e-runners:
&default-runner
build:
context: .
dockerfile: ./packages/manager/Dockerfile
target: e2e
depends_on:
web:
condition: service_healthy
env_file: ./packages/manager/.env
volumes: *default-volumes
entrypoint: ['yarn', 'cy:ci']
services:
# Serves a local instance of Cloud Manager for Cypress to use for its tests.
# Not all of the runner containers require a local instance of Cypress, but
# this service can be used in all cases.
web:
build:
context: .
dockerfile: ./packages/manager/Dockerfile
target: manager
container_name: web
ports:
- "3000:3000"
volumes:
- ./packages/manager:/home/node/app/packages/manager
- ./package.json:/home/node/app/package.json
- ./node_modules:/home/node/app/node_modules
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000']
interval: 15s
timeout: 10s
retries: 10
# Cypress runners for end-to-end tests.
e2e-1:
<<: *default-runner
container_name: cloud-e2e-1
environment:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH_1}
e2e-2:
<<: *default-runner
container_name: cloud-e2e-2
environment:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH_2}
e2e-3:
<<: *default-runner
container_name: cloud-e2e-3
environment:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH_3}
e2e-4:
<<: *default-runner
container_name: cloud-e2e-4
environment:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH_4}
region-1:
build:
context: .
dockerfile: ./packages/manager/Dockerfile
target: e2e
env_file: ./packages/manager/.env
volumes: *default-volumes
environment:
<<: *default-env
MANAGER_OAUTH: ${MANAGER_OAUTH_1}