.PHONY: build test deploy clean APP_NAME := server VERSION := $(shell git describe --tags --always) DOCKER_REGISTRY := registry.internal:5070 build: go build -ldflags "-X main.version=$(VERSION)" -o bin/$(APP_NAME) ./cmd/$(APP_NAME) test: go test ./... -v -cover -race lint: golangci-lint run ./... docker-build: docker build -t $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION) . docker-push: docker-build docker push $(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION) deploy-staging: kubectl -n staging set image deployment/$(APP_NAME) app=$(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION) deploy-production: @echo "Deploying $(VERSION) to production..." kubectl -n production set image deployment/$(APP_NAME) app=$(DOCKER_REGISTRY)/$(APP_NAME):$(VERSION) migrate: DATABASE_URL="$(DATABASE_URL)" go run ./cmd/migrate clean: rm -rf bin/ dist/