.PHONY: fmt test vet build run migrate bootstrap compose-up compose-down

fmt:
	gofmt -w $$(find cmd internal -name '*.go' -type f)

test:
	go test ./...

vet:
	go vet ./...

build:
	go build -trimpath -o bin/gateway-api ./cmd/gateway-api
	go build -trimpath -o bin/gateway-migrator ./cmd/gateway-migrator
	go build -trimpath -o bin/gateway-bootstrap ./cmd/gateway-bootstrap
	go build -trimpath -o bin/gateway-outbox-worker ./cmd/gateway-outbox-worker
	go build -trimpath -o bin/gateway-maintenance ./cmd/gateway-maintenance

run:
	go run ./cmd/gateway-api

migrate:
	go run ./cmd/gateway-migrator

bootstrap:
	go run ./cmd/gateway-bootstrap

compose-up:
	docker compose -f deploy/docker-compose.yml up -d --build

compose-down:
	docker compose -f deploy/docker-compose.yml down
