mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
add documentation to the makefile
This commit is contained in:
parent
5aa67ea1bf
commit
05a53d61b8
1 changed files with 15 additions and 8 deletions
23
Makefile
23
Makefile
|
|
@ -3,24 +3,31 @@ PORT=8000
|
|||
DB_USER=ruidy
|
||||
DB_NAME=villafleurie
|
||||
|
||||
build: format lint
|
||||
build: format lint ## Build the binary
|
||||
@docker build -t ${NAME}:latest .
|
||||
run: build
|
||||
run: build ## Run the binary
|
||||
@docker run -p ${PORT}:${PORT} -e DATABASE_URL="host=docker.for.mac.host.internal user=${DB_USER} database=${DB_NAME}" -e PORT=${PORT} ${NAME}
|
||||
dev:
|
||||
dev: ## Run the binary in dev mode
|
||||
@docker build -t ${NAME}:dev -f Dockerfile.dev .
|
||||
@docker run -p ${PORT}:${PORT} --rm -v `pwd`:/app -v /app/tmp --name ${NAME} -e DATABASE_URL="host=docker.for.mac.host.internal user=${DB_USER} database=${DB_NAME}" -e PORT=${PORT} ${NAME}:dev
|
||||
test:
|
||||
test: ## Run the tests
|
||||
@go test ./...
|
||||
up-deps:
|
||||
up-deps: ## Update dependencies
|
||||
@go get -u ./...
|
||||
cron:
|
||||
cron: ## Run the cron
|
||||
@go run cmd/cron/main.go
|
||||
format:
|
||||
format: ## Format the code
|
||||
@templ generate internal/views
|
||||
@templ fmt .
|
||||
@go fmt ./...
|
||||
lint:
|
||||
lint: ## Lint the code
|
||||
@golangci-lint run ./...
|
||||
|
||||
help: ## Display this help message
|
||||
@echo "Usage: make [command]"
|
||||
@echo
|
||||
@echo "Commands:"
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
.PHONY: build run dev templ format lint
|
||||
|
|
|
|||
Loading…
Reference in a new issue