Switch to new Swaggo Makefile template
Build Docker and Deploy / Build Docker Container (push) Failing after 1m38s Details
Build Docker and Deploy / Deploy to Server (push) Has been skipped Details

This commit is contained in:
Mike Schwörer 2023-10-17 15:53:39 +02:00
parent 0a380f861e
commit 13f3c64957
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 13 additions and 5 deletions

View File

@ -18,6 +18,8 @@ identifier.sqlite
.idea/dataSources.xml
.swaggobin
##############

View File

@ -7,6 +7,9 @@ HASH=$(shell git rev-parse HEAD)
.PHONY: test swagger pygmentize docker migrate dgi pygmentize lint docker
SWAGGO_VERSION=v1.8.12
SWAGGO=github.com/swaggo/swag/cmd/swag@$(SWAGGO_VERSION)
build: swagger pygmentize fmt
mkdir -p _build
rm -f ./_build/scn_backend
@ -39,9 +42,12 @@ docker: dgi
-t "$(DOCKER_REPO)/$(DOCKER_NAME):latest" \
.
swagger:
which swag || go install github.com/swaggo/swag/cmd/swag@v1.8.12
swag init -generalInfo api/router.go --propertyStrategy snakecase --output ./swagger/ --outputTypes "json,yaml"
swagger-setup:
mkdir -p ".swaggobin"
[ -f ".swaggobin/swag_$(SWAGGO_VERSION)" ] || { GOBIN=/tmp/_swaggo go install $(SWAGGO); cp "/tmp/_swaggo/swag" ".swaggobin/swag_$(SWAGGO_VERSION)"; rm -rf "/tmp/_swaggo"; }
swagger: swagger-setup
".swaggobin/swag_$(SWAGGO_VERSION)" init -generalInfo ./api/router.go --propertyStrategy camelcase --output ./swagger/ --outputTypes "json,yaml"
pygmentize: website/scn_send.html
@ -79,9 +85,9 @@ clean:
! which go 2>&1 >> /dev/null || go clean
! which go 2>&1 >> /dev/null || go clean -testcache
fmt:
fmt: setup-swagger
go fmt ./...
swag fmt
".swaggobin/swag_$(SWAGGO_VERSION)" fmt
test:
which gotestsum || go install gotest.tools/gotestsum@latest