-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
45 lines (36 loc) · 1020 Bytes
/
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
include .bingo/Variables.mk
.PHONY: generate-client, pull-schema, golangci-lint
##@ Generate Client
ifneq ($(API_TAG),)
CLIENT_GENERATION_ARGS += --tags=$(API_TAG)
$(info Generate client for API with tag '$(API_TAG)'')
endif
ifneq ($(MODEL),)
CLIENT_GENERATION_ARGS += --model=$(MODEL)
$(info Generate model '$(MODEL)')
endif
pull-schema:
bash ./scripts/pull-schema.sh
generate-client: ${SWAGGER} pull-schema
rm -rf ./models ./client
$(SWAGGER) generate client \
-f scripts/schema.json \
--skip-validation \
--with-flatten=remove-unused \
--additional-initialism=DTO \
--additional-initialism=API \
--additional-initialism=OK \
--additional-initialism=LDAP \
--additional-initialism=ACL \
--additional-initialism=SNS \
--additional-initialism=CSV \
--additional-initialism=PDF \
--template-dir=templates \
$(CLIENT_GENERATION_ARGS)
go mod tidy
golangci-lint:
docker run \
--rm \
--volume "$(shell pwd):/src" \
--workdir "/src" \
golangci/golangci-lint:v1.55 golangci-lint run ./... -v