Add SemVer VERSION, Jenkins CI/CD, and release 0.1.1.

Ship Harbor/Hub push with latest+version tags, deploy to ovirt.devops.org.ru, and show the package version badge in Help → About.
This commit is contained in:
2026-07-28 00:56:52 +03:00
parent af26ad4141
commit 540675597a
18 changed files with 599 additions and 27 deletions
+30 -19
View File
@@ -6,7 +6,7 @@ PYTEST_OFFLINE := -m "not integration and not compatibility"
# Docker Hub release image (runtime target only — not the local bind-mount "dev" image).
DOCKERHUB_USER ?= inecs
IMAGE_NAME ?= ovirt-api-simulator
VERSION ?= $(shell sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
VERSION ?= $(shell cat VERSION 2>/dev/null || echo 0.1.0)
DOCKER_IMAGE ?= $(DOCKERHUB_USER)/$(IMAGE_NAME)
PUSH_LATEST ?= 1
@@ -19,7 +19,7 @@ GIT_REMOTES ?= origin antropoff
LOCAL_ENGINE_PORT ?= 6443
LOCAL_UI_PORT ?= 6080
.PHONY: help install format lint typecheck test test-unit test-integration test-contract \
.PHONY: bump-patch bump-minor version-commit help install format lint typecheck test test-unit test-integration test-contract \
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 \
@@ -29,6 +29,8 @@ LOCAL_UI_PORT ?= 6080
help: ## Show available commands
@awk 'BEGIN {FS = ":.*## "}; /^[a-zA-Z0-9_-]+:.*## / {printf "%-22s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo
@echo "Version: $$(cat VERSION 2>/dev/null || echo 0.1.0) (make bump-patch | bump-minor)"
install: ## Build runtime and development images
@test -f .env || cp .env.example .env
@@ -223,29 +225,38 @@ clean-test-resources: ## Cleanup lab-created resources
# --- Git: stage, commit (prompt), push to both remotes ---
# Multi-line commit: paste message, then Ctrl-D (same UX as proxmox-api-simulator).
# Optional: make push MSG='one-line message'
push: ## git add . → multi-line commit (Ctrl-D) → push origin + antropoff
bump-patch: ## VERSION +0.0.1 (pyproject + Helm)
@PYTHONPATH=. python3 scripts/bump_version.py patch
@echo "VERSION → $$(cat VERSION)"
bump-minor: ## VERSION +0.1.0 (pyproject + Helm)
@PYTHONPATH=. python3 scripts/bump_version.py minor
@echo "VERSION → $$(cat VERSION)"
version-commit: ## Stage version files and commit "Bump version to …"
@git add VERSION pyproject.toml helm/ovirt-api-simulator/Chart.yaml helm/ovirt-api-simulator/values.yaml
@if git diff --cached --quiet; then \
echo "Nothing to commit for version files."; \
else \
git commit -m "Bump version to $$(cat VERSION)."; \
fi
push: ## bump-patch + commit version + push origin
@$(MAKE) bump-patch
@$(MAKE) version-commit
@set -e; \
git add .; \
echo "=== staged ==="; \
git status --short; \
echo; \
if git diff --cached --quiet; then \
echo "Nothing to commit — pushing current branch."; \
echo "Nothing else to commit — pushing current branch."; \
else \
if [ -n "$(MSG)" ]; then \
msg="$(MSG)"; \
else \
echo "Enter commit message, then Ctrl-D:"; \
msg=$$(cat </dev/tty); \
fi; \
if [ -z "$$msg" ]; then \
echo "Empty commit message, aborting." >&2; \
exit 1; \
fi; \
echo "Enter commit message for remaining changes, then Ctrl-D:"; \
msg=$$(cat </dev/tty); \
if [ -z "$$msg" ]; then echo "Empty commit message, aborting." >&2; exit 1; fi; \
git commit -m "$$msg"; \
fi; \
echo "Pushing to remotes: $(GIT_REMOTES)"; \
for remote in $(GIT_REMOTES); do \
echo "$$remote ($$(git remote get-url --push "$$remote"))"; \
git push -u "$$remote" HEAD; \
done
echo "Pushing to both remotes:"; \
git remote get-url --push --all origin | sed 's/^/ - /'; \
git push origin HEAD