Init: bootstrap
This commit is contained in:
28
Makefile
Normal file
28
Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
.PHONY: all swagger docker install test bench
|
||||
|
||||
SWAG ?= go run github.com/swaggo/swag/cmd/swag@v1.16.4
|
||||
|
||||
GO_ENV += CGO_ENABLED=0
|
||||
SOURCE := $(shell find . -type f -name '*.go')
|
||||
TARGET := backend
|
||||
|
||||
all: swagger docker install
|
||||
|
||||
docker: $(TARGET)
|
||||
docker compose up -d --force-recreate --build backend
|
||||
|
||||
install:
|
||||
$(GO_ENV) go install
|
||||
|
||||
test:
|
||||
go test -v ./tests/units
|
||||
|
||||
bench:
|
||||
go test -bench=. ./tests/benchmarks
|
||||
|
||||
swagger:
|
||||
$(SWAG) fmt
|
||||
$(SWAG) init -o docs -g cmds/serve.go -pdl 1
|
||||
|
||||
$(TARGET): $(SOURCE)
|
||||
$(GO_ENV) go build -o $@
|
||||
Reference in New Issue
Block a user