| .PHONY: generate build backend frontend cleanup-db \
|
| e2e-test e2e-backend-start e2e-backend-stop e2e-backend-status e2e-backend-restart e2e-backend-clean \
|
| migration-test migration-test-all migration-test-all-dbs \
|
| sync-faq sync-models filter-logs
|
|
|
|
|
| generate:
|
| @echo "Generating GraphQL and Ent code..."
|
| cd internal/server/gql && go generate
|
| @echo "Generation completed!"
|
|
|
| generate-openapi:
|
| @echo "Generating GraphQL and Ent code..."
|
| cd internal/server/gql/openapi && go generate
|
| @echo "Generation completed!"
|
|
|
|
|
| build-backend:
|
| @echo "Building axonhub backend..."
|
| go build -ldflags "-s -w" -tags=nomsgpack -o axonhub ./cmd/axonhub
|
| @echo "Backend build completed!"
|
|
|
|
|
| build-frontend:
|
| @echo "Building axonhub frontend..."
|
| cd frontend && pnpm vite build
|
| @echo "Copying frontend dist to server static directory..."
|
| rm -rf internal/server/static/dist/assets
|
| mkdir -p internal/server/static/dist
|
| cp -r frontend/dist/* internal/server/static/dist/
|
| @echo "Frontend build completed!"
|
|
|
|
|
| build: build-frontend build-backend
|
| @echo "Full build completed!"
|
|
|
|
|
| cleanup-db:
|
| @echo "Cleaning up playwright test data from database..."
|
| @sqlite3 axonhub.db "DELETE FROM user_roles WHERE user_id IN (SELECT id FROM users WHERE email LIKE 'pw-test-%' OR first_name LIKE 'pw-test%');"
|
| @sqlite3 axonhub.db "DELETE FROM user_projects WHERE user_id IN (SELECT id FROM users WHERE email LIKE 'pw-test-%' OR first_name LIKE 'pw-test%');"
|
| @sqlite3 axonhub.db "DELETE FROM user_projects WHERE project_id IN (SELECT id FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%');"
|
| @sqlite3 axonhub.db "DELETE FROM api_keys WHERE name LIKE 'pw-test-%';"
|
| @sqlite3 axonhub.db "DELETE FROM api_keys WHERE user_id IN (SELECT id FROM users WHERE email LIKE 'pw-test-%' OR first_name LIKE 'pw-test%');"
|
| @sqlite3 axonhub.db "DELETE FROM api_keys WHERE project_id IN (SELECT id FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%');"
|
| @sqlite3 axonhub.db "DELETE FROM roles WHERE code LIKE 'pw-test-%' OR name LIKE 'pw-test-%';"
|
| @sqlite3 axonhub.db "DELETE FROM roles WHERE project_id IN (SELECT id FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%');"
|
| @sqlite3 axonhub.db "DELETE FROM usage_logs WHERE project_id IN (SELECT id FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%');"
|
| @sqlite3 axonhub.db "DELETE FROM requests WHERE project_id IN (SELECT id FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%');"
|
| @sqlite3 axonhub.db "DELETE FROM users WHERE email LIKE 'pw-test-%' OR first_name LIKE 'pw-test%';"
|
| @sqlite3 axonhub.db "DELETE FROM projects WHERE slug LIKE 'pw-test-%' OR name LIKE 'pw-test-%';"
|
| @echo "Cleanup completed!"
|
|
|
|
|
|
|
|
|
| e2e-test:
|
| @echo "Running E2E tests..."
|
| @./scripts/e2e/e2e-test.sh
|
|
|
|
|
| e2e-backend-start:
|
| @echo "Starting E2E backend..."
|
| @./scripts/e2e/e2e-backend.sh start
|
|
|
|
|
| e2e-backend-stop:
|
| @echo "Stopping E2E backend..."
|
| @./scripts/e2e/e2e-backend.sh stop
|
|
|
|
|
| e2e-backend-status:
|
| @./scripts/e2e/e2e-backend.sh status
|
|
|
|
|
| e2e-backend-restart:
|
| @echo "Restarting E2E backend..."
|
| @./scripts/e2e/e2e-backend.sh restart
|
|
|
|
|
| e2e-backend-clean:
|
| @echo "Cleaning up E2E test files..."
|
| @./scripts/e2e/e2e-backend.sh clean
|
|
|
|
|
|
|
|
|
|
|
| migration-test:
|
| @if [ -z "$(TAG)" ]; then echo "Error: TAG is required. Usage: make migration-test TAG=v0.1.0"; exit 1; fi
|
| @echo "Running migration test from $(TAG)..."
|
| @./scripts/migration/migration-test.sh $(TAG)
|
|
|
|
|
| migration-test-all:
|
| @echo "Running migration tests for all versions..."
|
| @./scripts/migration/migration-test-all.sh
|
|
|
|
|
|
|
| migration-test-all-dbs:
|
| @if [ -z "$(TAG)" ]; then echo "Error: TAG is required. Usage: make migration-test-all-dbs TAG=v0.1.0"; exit 1; fi
|
| @echo "Running migration tests across all DBs from $(TAG)..."
|
| @./scripts/migration/test-migration-all-dbs.sh $(TAG)
|
|
|
|
|
|
|
|
|
| sync-faq:
|
| @echo "Syncing FAQ from GitHub..."
|
| @node ./scripts/sync/sync-github-faq.js
|
|
|
|
|
| sync-models:
|
| @echo "Syncing model developers..."
|
| @node ./scripts/sync/sync-model-developers.js
|
|
|
|
|
|
|
|
|
| filter-logs:
|
| @echo "Filtering load balance logs..."
|
| @./scripts/utils/filter-load-balance-logs.sh
|
|
|