Add OpenStack request-body schemas and nested console PARAM sync.
This commit is contained in:
@@ -13,13 +13,19 @@ PUSH_LATEST ?= 1
|
||||
COMPOSE_RELEASE ?= $(COMPOSE) -f docker-compose.release.yml
|
||||
HELM_CHART ?= ./helm/ovirt-api-simulator
|
||||
LAB ?= ./pulumi-tests
|
||||
# Remotes used by `make push` (GitHub + antropoff).
|
||||
GIT_REMOTES ?= origin antropoff
|
||||
# Preferred host ports for `make up-local` (override / .env stay gitignored).
|
||||
LOCAL_ENGINE_PORT ?= 6443
|
||||
LOCAL_UI_PORT ?= 6080
|
||||
|
||||
.PHONY: help install format lint typecheck test test-unit test-integration test-contract \
|
||||
test-surface test-versions coverage up down restart logs seed seed-demo smoke clean ci shell \
|
||||
test-surface test-versions coverage up down restart logs seed seed-small seed-large seed-big seed-demo \
|
||||
audit-seed-dump smoke clean ci shell \
|
||||
helm-template generate-packs \
|
||||
release release-build release-up release-down release-seed \
|
||||
test-pulumi-smoke test-pulumi pulumi-tests \
|
||||
test-smoke-all test-all clean-test-resources
|
||||
test-smoke-all test-all clean-test-resources push up-local down-local
|
||||
|
||||
help: ## Show available commands
|
||||
@awk 'BEGIN {FS = ":.*## "}; /^[a-zA-Z0-9_-]+:.*## / {printf "%-22s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
@@ -72,6 +78,52 @@ up: ## Start PostgreSQL, simulator, and Engine gateway
|
||||
@test -f .env || cp .env.example .env
|
||||
$(COMPOSE) up -d --build --wait
|
||||
|
||||
# Writes gitignored docker-compose.override.yml (+ syncs ports into .env) when
|
||||
# default 443/5000 are busy (common on macOS). Compose auto-merges the override.
|
||||
up-local: ## Start stack with local port override (not committed)
|
||||
@set -e; \
|
||||
test -f .env || cp .env.example .env; \
|
||||
pick_port() { \
|
||||
preferred="$$1"; shift; \
|
||||
for p in "$$preferred" "$$@"; do \
|
||||
if ! lsof -nP -iTCP:"$$p" -sTCP:LISTEN >/dev/null 2>&1; then \
|
||||
echo "$$p"; return 0; \
|
||||
fi; \
|
||||
done; \
|
||||
echo "No free port among: $$preferred $$*" >&2; exit 1; \
|
||||
}; \
|
||||
engine_port=$$(pick_port "$(LOCAL_ENGINE_PORT)" 6443 7443 8443 16443); \
|
||||
ui_port=$$(pick_port "$(LOCAL_UI_PORT)" 6080 7080 8080 16080); \
|
||||
printf '%s\n' \
|
||||
'# Generated by `make up-local` — gitignored, do not commit.' \
|
||||
'services:' \
|
||||
' api-gateway:' \
|
||||
' ports:' \
|
||||
" - \"$${engine_port}:443\"" \
|
||||
" - \"$${ui_port}:5000\"" \
|
||||
> docker-compose.override.yml; \
|
||||
if grep -q '^OVIRT_ENGINE_PORT=' .env; then \
|
||||
sed -i.bak -e "s/^OVIRT_ENGINE_PORT=.*/OVIRT_ENGINE_PORT=$${engine_port}/" \
|
||||
-e "s/^OVIRT_UI_PORT=.*/OVIRT_UI_PORT=$${ui_port}/" .env && rm -f .env.bak; \
|
||||
else \
|
||||
printf '\nOVIRT_ENGINE_PORT=%s\nOVIRT_UI_PORT=%s\n' "$$engine_port" "$$ui_port" >> .env; \
|
||||
fi; \
|
||||
echo "Local ports → Engine https://127.0.0.1:$${engine_port} UI http://127.0.0.1:$${ui_port}"; \
|
||||
echo "Wrote docker-compose.override.yml (gitignored)"; \
|
||||
$(COMPOSE) up -d --build --wait; \
|
||||
echo "up-local ok"
|
||||
|
||||
down-local: ## Stop stack and remove gitignored local port override
|
||||
@$(COMPOSE) down
|
||||
@rm -f docker-compose.override.yml
|
||||
@if [ -f .env ]; then \
|
||||
if grep -q '^OVIRT_ENGINE_PORT=' .env; then \
|
||||
sed -i.bak -e 's/^OVIRT_ENGINE_PORT=.*/OVIRT_ENGINE_PORT=443/' \
|
||||
-e 's/^OVIRT_UI_PORT=.*/OVIRT_UI_PORT=5000/' .env && rm -f .env.bak; \
|
||||
fi; \
|
||||
fi
|
||||
@echo "down-local ok (removed docker-compose.override.yml)"
|
||||
|
||||
down: ## Stop local services
|
||||
$(COMPOSE) down
|
||||
|
||||
@@ -85,12 +137,27 @@ logs: ## Follow logs
|
||||
seed: ## Seed minimal lab
|
||||
$(COMPOSE) run --rm --entrypoint python $(SERVICE_SIM) -m app.ovirt.seed_cli --profile minimal
|
||||
|
||||
seed-demo: ## Seed demo datacenter (~1000 VMs)
|
||||
$(COMPOSE) run --rm --entrypoint python $(SERVICE_SIM) -m app.ovirt.seed_cli --profile demo
|
||||
seed-small: ## Seed small cluster (3 hosts · 50 VMs)
|
||||
$(COMPOSE) run --rm --entrypoint python $(SERVICE_SIM) -m app.ovirt.seed_cli --profile small
|
||||
|
||||
seed-large: ## Seed large cluster (10 hosts · 1000 VMs)
|
||||
$(COMPOSE) run --rm --entrypoint python $(SERVICE_SIM) -m app.ovirt.seed_cli --profile large
|
||||
|
||||
seed-big: ## Seed big cluster (30 hosts · 2000 VMs)
|
||||
$(COMPOSE) run --rm --entrypoint python $(SERVICE_SIM) -m app.ovirt.seed_cli --profile big
|
||||
|
||||
seed-demo: seed-large ## Alias: large cluster (legacy name)
|
||||
|
||||
audit-seed-dump: ## Contract dump audit (collections+entities) vs live Engine
|
||||
@set -a; [ -f .env ] && . ./.env; set +a; \
|
||||
python3 tools/audit_seed_dump.py \
|
||||
"https://127.0.0.1:$${OVIRT_ENGINE_PORT:-443}" \
|
||||
"$${OVIRT_SERIES:-4.5}"
|
||||
|
||||
smoke: ## Quick Engine auth + list VMs smoke
|
||||
@curl -skf -u 'admin@internal:secret' -H 'Accept: application/json' -H 'Version: 4' \
|
||||
https://127.0.0.1:$${OVIRT_ENGINE_PORT:-443}/ovirt-engine/api/vms >/dev/null
|
||||
@set -a; [ -f .env ] && . ./.env; set +a; \
|
||||
curl -skf -u 'admin@internal:secret' -H 'Accept: application/json' -H 'Version: 4' \
|
||||
"https://127.0.0.1:$${OVIRT_ENGINE_PORT:-443}/ovirt-engine/api/vms" >/dev/null
|
||||
@echo "smoke ok"
|
||||
|
||||
helm-template: ## Render Helm chart
|
||||
@@ -152,3 +219,27 @@ test-all: ## Client lab full suite (Pulumi contract coverage)
|
||||
|
||||
clean-test-resources: ## Cleanup lab-created resources
|
||||
$(MAKE) -C $(LAB) clean-test-resources
|
||||
|
||||
# --- Git: stage, commit (prompt), push to both remotes ---
|
||||
push: ## git add . → ask for commit message → push to origin and antropoff
|
||||
@set -e; \
|
||||
git add .; \
|
||||
if git diff --cached --quiet; then \
|
||||
echo "Nothing staged to commit."; \
|
||||
else \
|
||||
if [ -n "$(MSG)" ]; then \
|
||||
msg="$(MSG)"; \
|
||||
else \
|
||||
printf "Commit message: "; \
|
||||
IFS= read -r msg </dev/tty; \
|
||||
fi; \
|
||||
if [ -z "$$msg" ]; then \
|
||||
echo "Empty commit message; aborting." >&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
git commit -m "$$msg"; \
|
||||
fi; \
|
||||
for remote in $(GIT_REMOTES); do \
|
||||
echo "→ pushing HEAD to $$remote"; \
|
||||
git push -u "$$remote" HEAD; \
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user