-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·52 lines (39 loc) · 1.45 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
42
43
44
45
46
47
48
49
50
51
52
CLIENT_APP_NAME := container-bridge-client
AGENT_APP_NAME := container-bridge-agent
BUILD := 0.1.1
OPEN_API_CODEGEN := github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
${OPEN_API_CODEGEN}:
$(eval TOOL=$(@:%=%))
@echo Installing ${TOOL}...
go install $(@:%=%)
tools: ${OPEN_API_CODEGEN}
OPEN_API_DIR = ./api
oapi-gen: tools oapi-gen-agent oapi-gen-client
oapi-gen-agent:
$(eval APP_NAME=agent)
@echo Generating server for ${APP_NAME}
@mkdir -p ${APP_NAME}/${OPEN_API_DIR}
${GOBIN}/oapi-codegen -config ./${APP_NAME}/cfg.yaml ./${APP_NAME}/openapi.yaml
oapi-gen-client:
$(eval APP_NAME=client)
@echo Generating server for ${APP_NAME}
@mkdir -p ${APP_NAME}/${OPEN_API_DIR}
${GOBIN}/oapi-codegen -config ./${APP_NAME}/cfg.yaml ./${APP_NAME}/openapi.yaml
start-docker-compose-test:
docker compose up -d --no-recreate
go test -timeout 120s -run ^Test* github.com/kube-tarian/container-bridge/integration_tests -v
stop-docker-compose-test:
docker compose down -v
build:
go mod download
CGO_ENABLED=0 go build -o build/client client/main.go
CGO_ENABLED=0 go build -o build/agent agent/main.go
clean:
rm -rf build
docker-build:
docker build -f dockerfiles/client/Dockerfile -t ${CLIENT_APP_NAME}:${BUILD} .
docker build -f dockerfiles/agent/Dockerfile -t ${AGENT_APP_NAME}:${BUILD} .
start-manual-test:
docker compose -f ./docker-compose_manual_test.yaml up -d --no-recreate
stop-manual-test:
docker compose -f ./docker-compose_manual_test.yaml down -v