2024-12-17 15:48:10 +00:00
|
|
|
GIT_VERSION = $(shell git describe --tags )
|
2024-12-15 08:39:18 +00:00
|
|
|
GOLANGCI_LINT := go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
|
|
|
|
SWAG := go run github.com/swaggo/swag/cmd/swag@v1.16.4
|
2024-12-15 06:36:33 +00:00
|
|
|
|
|
|
|
format:
|
2024-12-17 15:48:10 +00:00
|
|
|
@echo "🛠️ Format and Lint code with golangci-lint"
|
|
|
|
$(GOLANGCI_LINT) run
|
|
|
|
$(SWAG) fmt
|
|
|
|
@echo "✅ Format and Lint done."
|
|
|
|
|
|
|
|
format-fix:
|
2024-12-15 08:39:18 +00:00
|
|
|
@echo "🛠️ Format and Lint code with golangci-lint"
|
|
|
|
$(GOLANGCI_LINT) run --fix
|
|
|
|
$(SWAG) fmt
|
|
|
|
@echo "✅ Format and Lint done."
|
2024-12-15 06:36:33 +00:00
|
|
|
|
2024-12-15 08:39:18 +00:00
|
|
|
swag:
|
|
|
|
$(SWAG) init -g cmd/aides-repo-api/main.go
|
|
|
|
|
2024-12-17 15:48:10 +00:00
|
|
|
build:
|
|
|
|
go build \
|
|
|
|
-ldflags="-X 'code.alt-gnome.ru/aides-infra/aides-repo-api/internal/config.Version=$(GIT_VERSION)'" \
|
|
|
|
-o aides-repo-api \
|
|
|
|
./cmd/aides-repo-api/main.go
|
|
|
|
|
|
|
|
build-docker:
|
|
|
|
docker build -t ghcr.io/aides-infra/aides-repo-api .
|
|
|
|
|
2024-12-15 08:39:18 +00:00
|
|
|
.PHONY: format swag
|