# SiriusScan Docker Testing Makefile # Provides easy commands for testing and development .PHONY: help build test test-build test-health test-integration test-runtime-contract test-public-ghcr test-release-gates test-all test-security validate-ci-overhaul clean logs lint-docs lint-docs-quick lint-agents lint-agents-quick lint-agent-index regenerate-agents regenerate-agent check-agent-sync # Default target help: @echo "SiriusScan Docker Testing Commands" @echo "==================================" @echo "" @echo "Build Commands:" @echo " build-base Build base configuration" @echo " build-dev Build development configuration" @echo " build-prod Build production configuration" @echo " build-all Build all configurations" @echo "" @echo "Test Commands:" @echo " test-build Test individual container builds" @echo " test-health Test service health checks" @echo " test-integration Test service integration" @echo " test-runtime-contract Verify runtime auth/binary contracts" @echo " test-public-ghcr Verify anonymous GHCR access for compose images" @echo " test-release-gates Run release-blocking validation checks" @echo " test-security Run security/auth penetration tests" @echo " test-all Run all tests (build, health, integration, runtime auth contract)" @echo " validate-ci-overhaul Validate base images and CI pipeline changes" @echo "" @echo "Development Commands:" @echo " dev Start development environment" @echo " prod Start production environment" @echo " stop Stop all services" @echo " restart Restart all services" @echo "" @echo "Utility Commands:" @echo " clean Clean up containers and images" @echo " logs Show logs for all services" @echo " status Show status of all services" @echo "" @echo "Documentation Commands:" @echo " lint-docs Run full documentation linting" @echo " lint-docs-quick Run quick documentation checks" @echo " lint-index Check documentation index completeness" @echo "" @echo "Agent Identity Commands:" @echo " regenerate-agents Regenerate all agent identities" @echo " regenerate-agent Regenerate specific agent (PRODUCT=name)" @echo " check-agent-sync Check if agent identities need regeneration" @echo " lint-agents Run full agent identity linting" @echo " lint-agents-quick Run quick agent checks" @echo " lint-agent-index Check agent identity index completeness" # Build commands build-base: @echo "๐Ÿ”จ Building base configuration..." docker compose config --quiet @echo "โœ… Base configuration is valid" build-dev: @echo "๐Ÿ”จ Building development configuration..." docker compose -f docker-compose.yaml -f docker-compose.dev.yaml config --quiet @echo "โœ… Development configuration is valid" build-prod: @echo "๐Ÿ”จ Building production configuration..." docker compose config --quiet @echo "โœ… Production configuration is valid (base docker-compose.yaml)" build-all: build-base build-dev build-prod @echo "๐ŸŽ‰ All configurations are valid!" # Test commands test-build: @echo "๐Ÿงช Running build tests..." ./test-build.sh test-health: @echo "๐Ÿฅ Running health tests..." ./test-health.sh test-integration: @echo "๐Ÿ”— Running integration tests..." ./test-integration.sh test-runtime-contract: @echo "๐Ÿงท Verifying runtime auth/binary contracts..." @cd ../.. && \ POSTGRES_PASSWORD=$${POSTGRES_PASSWORD:-test-postgres-password} \ NEXTAUTH_SECRET=$${NEXTAUTH_SECRET:-test-nextauth-secret} \ INITIAL_ADMIN_PASSWORD=$${INITIAL_ADMIN_PASSWORD:-test-admin-password} \ DATABASE_URL=$${DATABASE_URL:-postgresql://postgres:test-postgres-password@sirius-postgres:5432/sirius} \ mkdir -p secrets && \ printf '%s\n' "$${SIRIUS_INTERNAL_API_KEY_TEST_VALUE:-test-api-key}" > secrets/sirius_api_key.txt && \ docker compose up -d && \ bash scripts/verify-runtime-auth-contract.sh && \ docker compose down test-public-ghcr: @echo "๐ŸŒ Verifying anonymous GHCR access for compose-rendered images..." @cd ../.. && bash scripts/verify-ghcr-public-access.sh "$${IMAGE_TAG:-latest}" test-release-gates: test-build test-integration test-runtime-contract @echo "โœ… Release-gating contract checks passed!" test-security: @echo "๐Ÿ”’ Running security penetration tests..." cd ../security && go run . @echo "โœ… Security tests completed!" test-all: test-build test-health test-integration test-runtime-contract @echo "๐ŸŽ‰ All tests completed (including runtime auth contract)!" # Development commands dev: @echo "๐Ÿš€ Starting development environment..." docker compose -f docker-compose.yaml -f docker-compose.dev.yaml up -d @echo "โœ… Development environment started" @echo "๐ŸŒ UI: http://localhost:3000" @echo "๐Ÿ”Œ API: http://localhost:9001" @echo "โš™๏ธ Engine: http://localhost:5174" prod: @echo "๐Ÿš€ Starting production environment..." docker compose up -d @echo "โœ… Production environment started (base docker-compose.yaml is production-ready)" @echo "๐ŸŒ UI: http://localhost:3000" @echo "๐Ÿ”Œ API: http://localhost:9001" @echo "โš™๏ธ Engine: http://localhost:5174" stop: @echo "๐Ÿ›‘ Stopping all services..." docker compose down @echo "โœ… All services stopped" restart: stop dev @echo "๐Ÿ”„ Services restarted" # Utility commands clean: @echo "๐Ÿงน Cleaning up containers and images..." docker compose down --volumes --remove-orphans docker system prune -f @echo "โœ… Cleanup completed" logs: @echo "๐Ÿ“‹ Showing logs for all services..." docker compose logs -f status: @echo "๐Ÿ“Š Service Status:" docker compose ps # Quick test for CI/CD ci-test: build-all test-build @echo "โœ… CI/CD tests passed!" # Validate CI/CD overhaul (base images + all app containers) validate-ci-overhaul: @echo "๐Ÿ”ฌ Validating CI/CD overhaul (base images, app builds, compose config)..." ../../scripts/validate-ci-overhaul.sh @echo "โœ… CI/CD overhaul validation passed!" # Full validation validate: build-all test-all @echo "๐ŸŽ‰ Full validation completed successfully!" # Documentation linting commands lint-docs: @echo "๐Ÿ“š Running full documentation linting..." ../../scripts/documentation/lint-docs.sh @echo "โœ… Documentation linting completed!" lint-docs-quick: @echo "๐Ÿ“š Running quick documentation checks..." ../../scripts/documentation/lint-quick.sh @echo "โœ… Quick documentation checks completed!" lint-index: @echo "๐Ÿ“š Running index completeness linting..." ../../scripts/documentation/lint-index.sh @echo "โœ… Index linting completed!" # Agent identity linting commands lint-agents: @echo "๐Ÿค– Running full agent identity linting..." cd ../../scripts/agent-identities && npm run validate @echo "โœ… Agent identity linting completed!" lint-agents-quick: @echo "๐Ÿค– Running quick agent checks..." cd ../../scripts/agent-identities && npm run validate @echo "โœ… Quick agent checks completed!" lint-agent-index: @echo "๐Ÿค– Checking agent identity index..." cd ../../scripts/agent-identities && npm run check-sync @echo "โœ… Agent index linting completed!" # Agent identity generation commands regenerate-agents: @echo "๐Ÿ”„ Regenerating agent identities..." cd ../../scripts/agent-identities && npm run generate -- --all @echo "โœ… Agent identities regenerated!" regenerate-agent: @echo "๐Ÿ”„ Regenerating $(PRODUCT) agent identity..." cd ../../scripts/agent-identities && npm run generate -- --product=$(PRODUCT) @echo "โœ… $(PRODUCT) agent identity regenerated!" check-agent-sync: @echo "๐Ÿ” Checking agent identity sync status..." cd ../../scripts/agent-identities && npm run check-sync # Full validation including documentation and agents validate-all: build-all test-all lint-docs lint-agents @echo "๐ŸŽ‰ Complete validation including documentation and agent identities completed successfully!"