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

Ship Harbor/Hub push with latest+version tags, deploy to vmware.devops.org.ru, and show the package version badge in Help → About.
This commit is contained in:
2026-07-28 00:57:11 +03:00
parent e8b08526d1
commit 229a705987
19 changed files with 606 additions and 20 deletions
+1
View File
@@ -21,6 +21,7 @@ Interactive console walkthrough: [Web UI](web-ui.md).
| [Seed profiles](seed-profiles.md) | Deterministic inventory fixtures |
| [Domains](domains/README.md) | Session, inventory, VM, storage, networking, tagging, SOAP, tasks, … |
| [Web UI](web-ui.md) | Interactive console and catalogs |
| [CI/CD (Jenkins)](ci-cd.md) | VERSION, Harbor/Hub push, deploy |
| [Operations](operations.md) | Reseed, migrate, release, upgrade |
| [Kubernetes / Helm](kubernetes.md) | Hub image + Ingress + Let's Encrypt |
| [Security](security.md) | Lab threat model and credentials |
+78
View File
@@ -0,0 +1,78 @@
**Language / Язык:** [English](ci-cd.md) | [Русский](ru/ci-cd.md)
# CI/CD (Jenkins + Gitea)
SemVer lives in [`VERSION`](../VERSION). Bump locally with `make bump-patch` /
`make bump-minor` (also syncs `pyproject.toml` and Helm chart/values). Jenkins
does **not** bump — it builds whatever is in the commit.
Public lab URL after deploy: **https://vmware.devops.org.ru/**
## Pipeline
Single [`Jenkinsfile`](../Jenkinsfile) on `main` / `master`:
1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64`
to Harbor and Docker Hub with tags **`:{VERSION}`** and **`:latest`** only.
2. **Deploy**`kubectl set image` on `simulators/simulators-vmware` (main
container `simulator` + initContainer `migrate`), then rollout status
(`--timeout=1200s`).
First cluster install (Ingress, Postgres, secrets) is **not** this job — use
`make addon-simulators` in DevOpsTools/K3S (`simulators_proxmox_host:
vmware.devops.org.ru`).
### Images
| Registry | Repository |
|---|---|
| Harbor | `hub.antropoff.ru/devops-tools/vmware-api-simulator` |
| Docker Hub | `inecs/vmware-api-simulator` |
### Credentials (Jenkins Global)
| ID | Type | Use |
|---|---|---|
| `harbor-devops-tools-push-pull-access` | Username/password | Harbor robot push |
| `docker-hub` | Username/password | Docker Hub `inecs` |
| `k3s-kubeconfig` | Secret file | Kubeconfig for deploy |
| `ssh-gitea-key` | SSH private key | Gitea SCM checkout |
## Gitea setup
1. Ensure the repo is on Gitea (mirror or primary) with branch `main`.
2. Deploy key / Jenkins credential `ssh-gitea-key` can clone the repo
(`git@…:…/vmware_api_simulator.git` or your path).
3. Optional: webhook from Gitea → Jenkins Multibranch (or rely on Jenkins SCM
polling / Organization Folder).
## Jenkins setup
1. **Credentials** — create the four IDs above if missing (same as Wrapped).
2. **Agent** — Kubernetes cloud pod template with label `docker` and a
`docker` container (DinD / buildx), same as Wrapped.
3. **Job** — Multibranch Pipeline (or Pipeline from SCM):
- Script Path: `Jenkinsfile`
- Branch discover: `main` (and `master` if needed)
- SCM: Gitea SSH URL + credential `ssh-gitea-key`
4. **Harbor project**`devops-tools` must allow the robot to push
`vmware-api-simulator` (create the repository on first push or pre-create).
5. **Docker Hub**`inecs/vmware-api-simulator` exists / push rights for
credential `docker-hub`.
6. **Cluster** — release `simulators` in namespace `simulators` already
installed (`make addon-simulators`). Deployment name must be
`simulators-vmware`.
7. Run once on `main` after bumping `VERSION` and pushing. Confirm:
- Harbor/Hub tags `:0.x.y` and `:latest`
- `kubectl -n simulators get deploy,ing`
- Help → About shows badge `v0.x.y` on https://vmware.devops.org.ru/
## Local release (without Jenkins)
```bash
make bump-patch # or bump-minor
make version-commit
git push origin HEAD
# or manual Hub-only:
make release # DOCKER_IMAGE=inecs/vmware-api-simulator
```
+1
View File
@@ -21,6 +21,7 @@
| [Профили seed](seed-profiles.md) | Детерминированные фикстуры инвентаря |
| [Домены](domains/README.md) | Session, inventory, VM, storage, networking, tagging, SOAP, tasks, … |
| [Web UI](web-ui.md) | Интерактивная консоль и каталоги |
| [CI/CD (Jenkins)](ci-cd.md) | VERSION, push Harbor/Hub, деплой |
| [Эксплуатация](operations.md) | Reseed, migrate, release, upgrade |
| [Kubernetes / Helm](kubernetes.md) | Образ Hub + Ingress + Let's Encrypt |
| [Безопасность](security.md) | Модель угроз лаборатории и учётные данные |
+77
View File
@@ -0,0 +1,77 @@
**Language / Язык:** [English](../ci-cd.md) | [Русский](ci-cd.md)
# CI/CD (Jenkins + Gitea)
SemVer хранится в [`VERSION`](../../VERSION). Локальный bump:
`make bump-patch` / `make bump-minor` (синхронизирует `pyproject.toml` и Helm).
Jenkins версию **не** поднимает — собирает то, что в коммите.
Публичный URL после деплоя: **https://vmware.devops.org.ru/**
## Pipeline
Один [`Jenkinsfile`](../../Jenkinsfile) на ветках `main` / `master`:
1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64`
в Harbor и Docker Hub, теги только **`:{VERSION}`** и **`:latest`**.
2. **Deploy**`kubectl set image` для `simulators/simulators-vmware`
(контейнер `simulator` + initContainer `migrate`), затем rollout status
(`--timeout=1200s`).
Первый install в кластере (Ingress, Postgres, секреты) — **не** этот job, а
`make addon-simulators` в DevOpsTools/K3S (`simulators_proxmox_host:
vmware.devops.org.ru`).
### Образы
| Registry | Repository |
|---|---|
| Harbor | `hub.antropoff.ru/devops-tools/vmware-api-simulator` |
| Docker Hub | `inecs/vmware-api-simulator` |
### Credentials (Jenkins Global)
| ID | Тип | Назначение |
|---|---|---|
| `harbor-devops-tools-push-pull-access` | Username/password | Push в Harbor |
| `docker-hub` | Username/password | Docker Hub `inecs` |
| `k3s-kubeconfig` | Secret file | Kubeconfig для deploy |
| `ssh-gitea-key` | SSH private key | Checkout из Gitea |
## Что сделать в Gitea
1. Репозиторий на Gitea (зеркало или primary), ветка `main`.
2. Deploy key / credential Jenkins `ssh-gitea-key` с правом clone
(`git@…:…/vmware_api_simulator.git`).
3. По желанию: webhook Gitea → Jenkins Multibranch (или polling / Organization
Folder).
## Что сделать в Jenkins
1. **Credentials** — четыре ID выше (как у Wrapped), если ещё нет.
2. **Agent** — pod template label `docker` с контейнером `docker` (DinD /
buildx), как у Wrapped.
3. **Job** — Multibranch Pipeline (или Pipeline from SCM):
- Script Path: `Jenkinsfile`
- Ветки: `main``master` при необходимости)
- SCM: SSH URL Gitea + `ssh-gitea-key`
4. **Harbor** — проект `devops-tools`, robot может push
`vmware-api-simulator`.
5. **Docker Hub** — репозиторий `inecs/vmware-api-simulator`, права у
`docker-hub`.
6. **Кластер** — релиз `simulators` в ns `simulators` уже установлен
(`make addon-simulators`). Deployment: `simulators-vmware`.
7. После bump `VERSION` и push в `main` — прогнать job и проверить:
- теги `:0.x.y` и `:latest` в Harbor/Hub
- `kubectl -n simulators get deploy,ing`
- Help → About: badge `v0.x.y` на https://vmware.devops.org.ru/
## Локальный релиз без Jenkins
```bash
make bump-patch # или bump-minor
make version-commit
git push origin HEAD
# или только Hub вручную:
make release
```