diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 47f654b..81cee65 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -94,6 +94,21 @@ export default defineConfig({ { text: 'Docker Compose', link: '/infrastructure/docker' }, { text: 'K8s + Terraform + ArgoCD + Gitea', link: '/infrastructure/k8s-cicd-platform-plan' }, { text: 'Backend: внешние сервисы (test/stage/prod)', link: '/infrastructure/backend-external-services' }, + { + text: 'Локальная ферма k8s (Multipass)', + collapsed: false, + items: [ + { text: 'Обзор', link: '/infrastructure/local-k8s/' }, + { text: 'Доступы и /etc/hosts', link: '/infrastructure/local-k8s/access' }, + { text: 'Запуск 4 VM', link: '/infrastructure/local-k8s/local-nonprod' }, + { text: 'CI/CD и Loki', link: '/infrastructure/local-k8s/ci-and-logs' }, + { text: 'Чеклист проверки', link: '/infrastructure/local-k8s/checklist-verify' }, + { text: 'Git-flow (кратко)', link: '/infrastructure/local-k8s/git-flow' }, + { text: 'Argo CD: test-contour и promtail-test', link: '/infrastructure/local-k8s/argocd-contours' }, + { text: 'Redmine #27: ветки issues/27', link: '/infrastructure/local-k8s/issues-27-branches' }, + { text: 'Redmine ↔ Gitea (MR)', link: '/infrastructure/local-k8s/redmine-gitea' } + ] + }, { text: 'Test-контур k3s (песочница)', collapsed: false, diff --git a/infrastructure/local-k8s/index.md b/infrastructure/local-k8s/index.md new file mode 100644 index 0000000..4dbbd46 --- /dev/null +++ b/infrastructure/local-k8s/index.md @@ -0,0 +1,18 @@ +# Локальная ферма k8s (Multipass, 4 VM) + +Операционная документация каталога **`k8s/`** (не путать с репозиторием Gitea `sova/docs` — это VitePress-сайт в `sova-docs/`). + +| Страница | Содержание | +|----------|------------| +| [Доступы и /etc/hosts](./access) | URL, порты, логины | +| [Запуск non-prod](./local-nonprod) | 4 VM, bootstrap, GitOps | +| [CI/CD и Loki](./ci-and-logs) | теги, registry, Grafana Explore | +| [Чеклист проверки](./checklist-verify) | smoke после поднятия | +| [Git-flow (кратко)](./git-flow) | ветки, теги → [полная версия](../test-contour/git-flow) | +| [Argo CD: test-contour и promtail-test](./argocd-contours) | зонтик GitOps и Promtail | +| [Redmine #27: ветки issues/27](./issues-27-branches) | перенос из monorepo → Gitea | +| [Redmine ↔ Gitea (MR → #27)](./redmine-gitea) | webhook, проект «Новый сайт» | + +План платформы: [K8s + Terraform + ArgoCD](../k8s-cicd-platform-plan). + +Скрипты: `k8s/scripts/` (`print-urls-4vm.sh`, `print-credentials.sh`, `bootstrap-local-multicluster.sh`). diff --git a/infrastructure/local-k8s/redmine-gitea.md b/infrastructure/local-k8s/redmine-gitea.md new file mode 100644 index 0000000..8d3a3a9 --- /dev/null +++ b/infrastructure/local-k8s/redmine-gitea.md @@ -0,0 +1,65 @@ +# Redmine ↔ Gitea (MR → задача #N) + +## Модель + +| Компонент | Назначение | +|-----------|------------| +| **Redmine** | Проект **«Новый сайт»** (`novyj-sajt`), задача **#27** | +| **Gitea** | `backend`, `adminpanel`, `cabinet`, `docs` | +| **redmine-gitea-bridge** | Webhook `pull_request` → комментарий в Redmine со ссылкой на MR | + +Несколько MR (например backend + adminpanel) с `#27` в заголовке/описании → **несколько комментариев** в одной задаче #27. + +## Подготовка + +```bash +cd k8s +./scripts/bootstrap-redmine.sh +./scripts/setup-gitea-redmine-integration.sh +``` + +Скрипт сам находит кластер с `namespace redmine` и Multipass VM по `kubectl get nodes` (например `sova-test` → `192.168.252.2`, не обязательно `vm-k8s-app-test`). + +В `/etc/hosts` — IP из вывода скрипта (`mp_print_kubectl_target`): + +```text +192.168.252.2 redmine.sova.local # пример: кластер sova-test +``` + +## Правило для MR + +В **заголовке или описании** pull request: + +```text +Refs #27 +``` + +или `#27` — иначе bridge не привяжет MR к задаче. + +Пример заголовка: + +```text +feat(adminpanel): content CRUD generic pages (Refs #27) +``` + +## Что настроит скрипт + +1. Deployment `redmine-gitea-bridge` (NodePort **30388** на VM с Redmine). +2. В каждом repo Gitea: + - **External tracker** → `http://redmine.sova.local/issues/{index}` + - **Webhook** `pull_request` → bridge. + +## Проверка + +```bash +curl -s http://:30388/healthz +``` + +Создайте MR в Gitea с **`#27`**, **`Refs #27`** или веткой/заголовком **`issues/27`** → в Redmine на [#27](http://redmine.sova.local/issues/27) появится комментарий со ссылкой (Textile, URL с портом `:30300`). + +Если webhook не сработал: `./scripts/sync-redmine-mr-notes.sh 27 backend adminpanel` + +## Связанные документы + +- [Git-flow](./git-flow) +- [Redmine (test-contour)](../test-contour/guides/redmine.md)