mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
Some checks are pending
CI / checks (push) Waiting to run
- Add `APP_STRIPE_ACCOUNT_ID` to config and README. - Pass Stripe account ID to payment view models. - Show "View in Stripe" badge linking to the payment in Stripe dashboard for card payments when account ID and payment ID are present. - Update Makefile to run format/lint locally instead of in container. - Update templates and generated code to support new dashboard link.
42 lines
1.3 KiB
Makefile
42 lines
1.3 KiB
Makefile
# Defaults (override via `make VAR=value`)
|
|
NAME ?= rentease
|
|
PORT ?= 8000
|
|
DB_USER ?= ruidy
|
|
DB_NAME ?= villafleurie
|
|
|
|
DOCKER_RUN_ENV = -e DATABASE_URL="host=docker.for.mac.host.internal user=$(DB_USER) database=$(DB_NAME)" -e PORT=$(PORT)
|
|
|
|
.PHONY: help build run dev test up-deps format lint stop
|
|
|
|
help: ## List available commands
|
|
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-12s %s\n", $$1, $$2}'
|
|
|
|
build: format lint ## Build the production Docker image
|
|
docker build -t $(NAME):latest .
|
|
|
|
run: build ## Run the production container (port $(PORT))
|
|
docker run -p $(PORT):$(PORT) $(DOCKER_RUN_ENV) $(NAME)
|
|
|
|
dev: ## Build and run the dev container with live reload (Air)
|
|
docker build -t $(NAME):dev -f Dockerfile.dev .
|
|
docker run -p $(PORT):$(PORT) --rm \
|
|
-v `pwd`:/app -v /app/tmp \
|
|
--name $(NAME) \
|
|
$(DOCKER_RUN_ENV) $(NAME):dev
|
|
|
|
test: ## Run Go tests inside the running dev container
|
|
go test ./...
|
|
|
|
up-deps: ## Update Go dependencies on host
|
|
go get -u ./...
|
|
|
|
format: ## Generate templ files and format code locally
|
|
templ generate internal/view
|
|
templ fmt .
|
|
go fmt ./...
|
|
|
|
lint: ## Lint the code using golangci-lint locally
|
|
golangci-lint run ./...
|
|
|
|
stop: ## Stop the dev container
|
|
-@docker stop $(NAME) >/dev/null 2>&1 || true
|