forked from DeviceFarmer/stf
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose-test.yaml
76 lines (75 loc) · 2.21 KB
/
docker-compose-test.yaml
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
version: "3"
services:
mongo1:
image: mongo:6.0.10
hostname: mongo1
container_name: mongo1
entrypoint:
["mongod", "--replSet", "myReplicaSet", "--bind_ip", "localhost,mongo1"]
mongosetup:
image: mongo:6.0.10
depends_on:
- mongo1
volumes:
- ./scripts/mongo_setup_test.sh:/scripts/mongo_setup_test.sh
restart: "no"
entrypoint: ["bash", "/scripts/mongo_setup_test.sh"]
adb:
container_name: adb
image: devicefarmer/adb:latest
restart: unless-stopped
volumes:
- "/dev/bus/usb:/dev/bus/usb"
privileged: true
devicehub:
container_name: devicehub
build: .
image: devicehub:latest
ports:
- "7100:7100"
- "7110:7110"
- "7400-7500:7400-7500"
environment:
- TZ='America/Los_Angeles'
- MONGODB_PORT_27017_TCP=mongodb://mongo1:27017
- STF_ADMIN_NAME=administrator
restart: unless-stopped
command: stf local --adb-host adb --public-ip 0.0.0.0 --provider-min-port 7400 --provider-max-port 7500
healthcheck:
test: [ "CMD", "curl", "-f", "http://devicehub:7100/auth/contact" ]
interval: 20s
timeout: 10s
retries: 5
depends_on:
mongosetup:
condition: service_completed_successfully
adb:
condition: service_started
devicehub-generate-fake-device:
image: devicehub:latest
environment:
- MONGODB_PORT_27017_TCP=mongodb://mongo1:27017
container_name: devicehub-generate-fake-device
command: stf generate-fake-device fake-device-type --number 5
depends_on:
devicehub:
condition: service_healthy
restart: "no"
devicehub-pytest:
build: test/api/
environment:
- PIP_DISABLE_PIP_VERSION_CHECK=1
container_name: devicehub-pytest
command:
- /bin/sh
- -c
- |
. /scripts/token.sh &&
pytest ./ --token=$$STF_TOKEN --base-url=http://devicehub:7100 --log-cli-level=DEBUG
volumes:
- ./scripts/token.sh:/scripts/token.sh
depends_on:
devicehub-generate-fake-device:
condition: service_completed_successfully
restart: "no"