forked from haproxytech/client-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (36 loc) · 1.32 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
PROJECT_PATH=${PWD}
DOCKER_HAPROXY_VERSION?=2.4
SWAGGER_VERSION=v0.29.0
.PHONY: test
test:
go test ./...
.PHONY: e2e
e2e:
go test -tags integration ./...
.PHONY: e2e-docker
e2e-docker:
docker build -f e2e/Dockerfile --build-arg HAPROXY_VERSION=${DOCKER_HAPROXY_VERSION} -t client-native-test:${DOCKER_HAPROXY_VERSION} .
docker run --rm -it client-native-test:${DOCKER_HAPROXY_VERSION}
.PHONY: spec
spec:
go run specification/build/build.go -file specification/haproxy-spec.yaml > specification/build/haproxy_spec.yaml
.PHONY: models-native
models-native: spec
swagger generate model -f ${PROJECT_PATH}/specification/build/haproxy_spec.yaml -r ${PROJECT_PATH}/specification/copyright.txt -m models -t ${PROJECT_PATH}
.PHONY: models
models: spec
cd build/models;docker build \
--build-arg SWAGGER_VERSION=${SWAGGER_VERSION} \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
-t client-native-models .
docker run --rm -it -v "$(PWD)":/data client-native-models
ls -lah models
.PHONY: lint
lint:
docker run --rm -v $(pwd):/data cytopia/yamllint .
docker run --rm ghcr.io/haproxytech/go-linter:1.46.2 --version
docker run --rm -v ${PROJECT_PATH}:/app -w /app ghcr.io/haproxytech/go-linter:1.46.2 --timeout 5m --color always --max-issues-per-linter 0 --max-same-issues 0
.PHONY: gofumpt
gofumpt:
gofumpt -l -w .