Makefile update with doc generation and convenience installers

This commit is contained in:
Imbus 2024-03-08 10:17:51 +01:00
parent ae0b0895b2
commit d4a2a00f69

View file

@ -13,7 +13,7 @@ MIGRATIONS_DIR = internal/database/migrations
# Build target
build:
$(GOBUILD) -o bin/server cmd/*.go
$(GOBUILD) -o bin/server main.go
# Run target
run: build
@ -71,6 +71,21 @@ lint:
# Default target
default: build
# Generate swagger docs
.PHONY: docs
docs:
swag init -outputTypes go
install-swag:
@echo "Installing swag"
@go get -u github.com/swaggo/swag/cmd/swag
# Convenience target to install golangci-lint
install-lint:
@echo "Installing golangci-lint"
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.42.1
# Convenience target to install just (requires sudo privileges)
install-just:
@echo "Installing just"
@curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin