Init: bootstrap go module with basic framework
This commit is contained in:
27
Makefile
Normal file
27
Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
.PHONY: all swagger docker install test sh
|
||||
|
||||
SWAG ?= ~/go/bin/swag
|
||||
|
||||
GO_ENV += CGO_ENABLED=0
|
||||
TARGET := $(shell find . -type f -name '*.go')
|
||||
|
||||
all: swagger docker install
|
||||
|
||||
docker: amane
|
||||
docker compose up -d --force-recreate --build backend
|
||||
|
||||
install:
|
||||
$(GO_ENV) go install
|
||||
|
||||
test:
|
||||
go test -v ./tests/units
|
||||
|
||||
swagger:
|
||||
$(SWAG) fmt
|
||||
$(SWAG) init -o handlers/docs -g cmd/backend.go -pdl 1
|
||||
|
||||
amane: $(TARGET)
|
||||
$(GO_ENV) go build -o $@
|
||||
|
||||
sh:
|
||||
docker compose exec -it backend sh
|
||||
Reference in New Issue
Block a user