Files
ocdp-go/Makefile
Ivan087 33ddaf97db fix: scale replicas in response, K8s metrics client, quota precheck, auth tests
- Add GetMetrics method to MetricsClient interface and implement cluster metrics API
- Add QuotaPrecheck service for validating resource quotas before deployment
- Add auth DTO with role/permission models and auth handler tests
- Add instance diagnostics: mounted NFS volumes, labels, annotations in pod diagnostics
- Update workspace handler with GetWorkspace endpoint and shared-user list
- Fix monitoring handler to use correct service method name
- Add tail_lines fallback in instance handler for snake_case query params
- Update nginx config for SSE log streaming support (no buffering)
- Add comprehensive test coverage: auth_service_test, auth_handler_test,
  auth_dto_test, metrics_client_test, quota_precheck_test
- Update error messages for quota validation and instance operations
- ModifyModal: fix YAML lineWidth:0, modified keys summary, delta-only submit
- InstanceCard: correctly disable scale-minus when replicas <= 0
- SidebarLayout: add hover transition for sidebar items
- Update todo.md and lessons.md with latest fixes
2026-05-20 16:56:29 +08:00

86 lines
2.4 KiB
Makefile

# ============================================================
# OCDP root orchestration Makefile
# ============================================================
SHELL := /bin/bash
COMPOSE_BIN ?= docker compose
ROOT_COMPOSE := docker-compose.yml
COMPOSE := $(COMPOSE_BIN) -f $(ROOT_COMPOSE)
.PHONY: help install up restart stop clean run-2 clean-2 docker-dev docker-prod docker-up docker-down docker-logs docker-ps test
.DEFAULT_GOAL := help
help:
@echo ""
@echo "OCDP commands"
@echo "────────────────────────────────────────"
@echo " make install Install local Go / frontend dependencies"
@echo " make up Build and start the complete platform: DB + API + web gateway"
@echo " make restart Restart the complete platform without removing volumes"
@echo " make stop Stop containers, keep volumes"
@echo " make clean Stop containers and remove project volumes"
@echo " make run-2 Alias of up, kept for old docs / muscle memory"
@echo " make docker-dev Alias of up"
@echo " make docker-prod Alias of up"
@echo " make docker-up Alias of up"
@echo " make docker-down Stop containers, keep volumes"
@echo " make clean-2 Stop containers and remove project volumes"
@echo " make docker-logs Follow Compose logs"
@echo " make docker-ps Show Compose service status"
@echo " make test Run structured verification script"
@echo ""
@echo "Default local ports: web=18080, https=18443, backend=18081, postgres=15432"
@echo "Override with WEB_HTTP_PORT / WEB_HTTPS_PORT / BACKEND_PORT / POSTGRES_PORT."
@echo ""
install:
@echo "→ Downloading backend modules"
@cd backend && go mod download
@echo "→ Installing frontend dependencies"
@cd frontend && npm ci
up:
@echo "→ Building and starting OCDP stack"
@$(COMPOSE) up --build -d
@echo ""
@$(COMPOSE) ps -a
@echo ""
@echo "Web: http://localhost:$${WEB_HTTP_PORT:-18080}"
@echo "Backend: http://localhost:$${BACKEND_PORT:-18081}/health"
restart:
@echo "→ Restarting OCDP stack"
@$(COMPOSE) up --build -d --force-recreate
@$(COMPOSE) ps -a
stop:
@$(COMPOSE) down --remove-orphans
clean:
@$(COMPOSE) down -v --remove-orphans
run-2: up
docker-dev: up
docker-prod: up
docker-up: up
docker-down:
@$(MAKE) stop
clean-2:
@$(MAKE) clean
docker-logs:
@$(COMPOSE) logs -f
docker-ps:
@$(COMPOSE) ps -a
test:
@test/readme-deployment-refresh.sh