-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.27 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
53
54
55
56
57
58
59
60
VERSION=0.1.21
all: gen test lint vet build
build: pax
pax:
@cd cmd/$@ && go build -o ../../bin/$@
ang:
@cd cmd/$@ && go build -o ../../bin/$@
lint:
@revive ./...
vet:
@go vet ./...
test:
@go test ./...
gen:
@buf generate
count:
@gocloc --not-match-d 'pkg/pax|frontend' .
clean:
@rm -rf bin pkg/pax doc/swagger
docker-image: gen test
@echo "Cross compiling"
@cd cmd/pax && GOOS=linux GOARCH=amd64 go build -o ../../bin/pax-linux --trimpath -tags osusergo,netgo -ldflags="-s -w"
@docker build -t pax . && \
docker tag pax:latest borud/pax:$(VERSION)
docker tag pax:latest borud/pax:latest
docker-push:
@echo "Pushing new docker image"
@docker push borud/pax:$(VERSION)
@docker push borud/pax:latest
SPEC:=$(PWD)/doc/swagger/pax/v1
GEN:=$(PWD)/frontend/src/app/api/pax
openapi-client:
@mkdir -p $(GEN)/model/
@rm -f $(GEN)/model/*.ts
@docker run --platform linux/arm64 \
-v$(GEN):/gen \
-v$(SPEC):/spec \
-it openapitools/openapi-generator-cli:v6.2.1 generate \
--git-user-id=lab5e \
--git-repo-id=pax-client \
--package-name pax-client \
-g typescript-angular -i /spec/service.swagger.json -o /gen
@rm -fR $(GEN)/.openapi-generator
@rm -fR $(GEN)/*.sh
@rm -fR $(GEN)/.gitignore
@rm -fR $(GEN)/README.md
@rm -fR $(GEN)/.openapi-generator-ignore