forked from beedemo/go-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-test.yml
52 lines (45 loc) · 1.31 KB
/
docker-compose-test.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
version: '3.2'
services:
unit-cache:
build:
context: .
dockerfile: Dockerfile.build
cache_from:
- beedemo/go-demo:unit-cache
args:
- COMMIT_SHA
volumes:
- .:/usr/src/myapp
working_dir: /usr/src/myapp
command: ash -c "pwd && go get -u github.com/jstemmer/go-junit-report && go get -d -v -t && go test --cover -v ./... && go build -v -o go-demo"
unit:
image: ${UNIT_CACHE_IMAGE}
volumes:
- .:/usr/src/myapp
working_dir: /usr/src/myapp
command: ash -c "pwd && go test --cover -v ./... 2>&1 | go-junit-report > report.xml && go build -v -o go-demo"
staging-dep:
image: beedemo/go-demo
ports:
- 8080:8080
depends_on:
- db
staging:
image: ${UNIT_CACHE_IMAGE}
volumes:
- .:/usr/src/myapp
working_dir: /usr/src/myapp
environment:
- HOST_IP=localhost:8080
network_mode: host
command: ash -c "cd /usr/src/myapp && go get -d -v -t && go test --tags integration -v 2>&1 | go-junit-report > report.xml"
production:
image: ${UNIT_CACHE_IMAGE}
volumes:
- .:/usr/src/myapp
working_dir: /usr/src/myapp
environment:
- HOST_IP=${HOST_IP}
command: ash -c "cd /usr/src/myapp && go get -d -v -t && go test --tags integration -v"
db:
image: mongo:3.2.10