-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (40 loc) · 1.09 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
61
TAG ?= head
COMMIT_SHA ?= devel
OUT ?= bin/
BUILDTAGS ?= box,swagger,prometheus
all: clean setup js build
setup:
npm ci
go mod download
js:
npm run build
# GO Binary (May depend on npm commands first)
build: generate swagger bin
bin: server cli
server:
go build -ldflags "-X main.version=${TAG} -X main.buildSha=${COMMIT_SHA}" -tags ${BUILDTAGS} -o ${OUT}simple-auth-server simple-auth/cmd/server
cli:
go build -ldflags "-X main.version=${TAG} -X main.buildSha=${COMMIT_SHA}" -tags boxconfig -o ${OUT}simple-auth-cli simple-auth/cmd/cli
rundev:
go run -tags swagger,prometheus simple-auth/cmd/server --include=simpleauth.yml
generate:
go generate ./...
swagger:
go run github.com/swaggo/swag/cmd/swag init -o pkg/swagdocs -g pkg/routes/api/api.go
# TESTING
integrationtest:
./tests/quicktest.sh
unittest:
go test -race ./...
vet:
go vet $$(go list ./... | grep -v "vendor")
staticcheck:
go run honnef.co/go/tools/cmd/staticcheck ./...
test: unittest vet
check: test staticcheck integrationtest
# CLEANING
clean:
rm -rf dist/
rm -f pkg/box/*.gen.go
rm -rf pkg/swagdocs
rm -rf bin/