-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 805 Bytes
/
Makefile
File metadata and controls
33 lines (26 loc) · 805 Bytes
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
EXEC_NAME?=go-api
DOCKER_RUNNER?=docker
REGISTRY?=localhost:5000
RELEASE_TAG=$(shell git rev-parse --short HEAD)
BASE_TAG=$(REGISTRY)/utdnebula/api/go-api
setup:
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/swaggo/swag/cmd/swag@latest
check:
go mod tidy
go vet ./...
staticcheck ./...
gofmt -w ./..
goimports -w ./..
test:
go test ./... -count=1
build: server.go
swag fmt
swag init -g server.go --outputTypes yaml,go
go build -o $(EXEC_NAME) server.go
clean: $(EXEC_NAME)
rm $(EXEC_NAME)
docker: Dockerfile common/ configs/ controllers/ docs/ responses/ routes/ schema/ server.go
$(DOCKER_RUNNER) build -t $(BASE_TAG):$(RELEASE_TAG) .
$(DOCKER_RUNNER) tag $(BASE_TAG):$(RELEASE_TAG) $(BASE_TAG):latest