-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (29 loc) · 1.24 KB
/
Makefile
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
PROJECT=argo
VERSION=1.0.0
# CGO_ENABLED=0 means we're not looking for C libs when using the network packages (these libs are absent in a scratch images)
# GO111MODULE=on means we are using modules and not the old vendor dir and GO*** env variables
GO=GO111MODULE=on CGO_ENABLED=0 go
FRONT=front
PORTDOMAIN=portdomain
local-build:
${GO} build -o build/front/front.out ./services/front/service/cmd
${GO} build -o build/portdomain/portdomain.out ./services/portdomain/service/cmd
test:
${GO} test ./...
cover:
${GO} test ./... -cover
docker-build: local-build
docker build -t ${PROJECT}-${FRONT}:${VERSION} build/front
docker build -t ${PROJECT}-${PORTDOMAIN}:${VERSION} build/portdomain
docker-run: network run-front run-portdomain
network:
docker network create --subnet=172.18.0.0/16 network-${PROJECT} || true
run-front:
docker run -d -p 8411:8411 --network network-${PROJECT} --ip 172.18.0.22 -v ${PWD}/testdata:/tmp --rm --name ${FRONT} ${PROJECT}-${FRONT}:${VERSION}
run-portdomain:
docker run -d -p 8405:8405 --network network-${PROJECT} --ip 172.18.0.23 --rm --name ${PORTDOMAIN} ${PROJECT}-${PORTDOMAIN}:${VERSION}
stop: stop-front stop-portdomain
stop-front:
docker stop ${FRONT} || true
stop-portdomain:
docker stop ${PORTDOMAIN} || true