3d47227fbd
Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
41 lines
1019 B
Makefile
41 lines
1019 B
Makefile
APP := agent-desk-server
|
|
MAIN := ./cmd/server
|
|
DIST_DIR := dist
|
|
FRONTEND_DIR ?= ../agent-desk-web
|
|
|
|
GO ?= go
|
|
DEV_PORT ?= 8083
|
|
|
|
.DEFAULT_GOAL := build
|
|
|
|
.PHONY: help dev build test generator enums clean
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " make dev Start the API server on port $(DEV_PORT)"
|
|
@echo " make build Build the API binary into $(DIST_DIR)/"
|
|
@echo " make test Run all Go tests"
|
|
@echo " make generator Run backend code generation"
|
|
@echo " make enums Generate frontend enums into $(FRONTEND_DIR)"
|
|
@echo " make clean Remove backend build output"
|
|
|
|
dev:
|
|
@AGENT_DESK_SERVER_PORT="$(DEV_PORT)" $(GO) run -tags dev $(MAIN)
|
|
|
|
build:
|
|
@mkdir -p $(DIST_DIR)
|
|
@$(GO) build -v -o $(DIST_DIR)/$(APP) $(MAIN)
|
|
|
|
test:
|
|
@$(GO) test ./...
|
|
|
|
generator:
|
|
@$(GO) run ./cmd/generator/generator.go
|
|
|
|
enums:
|
|
@$(GO) run ./cmd/enums/generator.go -output "$(FRONTEND_DIR)/lib/generated/enums.ts"
|
|
|
|
clean:
|
|
@$(GO) clean
|
|
@find $(DIST_DIR) -mindepth 1 -maxdepth 1 -type f -delete 2>/dev/null || true
|