From f431fc3c1c6a81888d7d8db4b23912bee7ec2a03 Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Mon, 27 Jul 2026 22:54:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20Jenkins=20credentials=20=D0=BF=D0=BE=D0=B4=20ssh?= =?UTF-8?q?-gitea-key=20=D0=B8=20=D0=BE=D1=81=D1=82=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B5=20Global=20ID.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 13 +++++++------ Jenkinsfile.deploy | 4 ++-- README.md | 15 +++++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bff29c0..c18d145 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,10 +3,11 @@ // Триггер: push в main (webhook Gitea → Jenkins Multibranch). // Коммиты с [skip ci] в сообщении — без повторного bump (анти-цикл после version commit). // -// Credentials: -// harbor-devops-tools-push-pull-access — Harbor devops-tools -// docker-hub — Docker Hub -// gitea-ssh (или GIT_SSH_CREDENTIALS_ID) — SSH для push bump-коммита +// Credentials (Manage Jenkins → Credentials → Global): +// harbor-devops-tools-push-pull-access — Harbor devops-tools (robot) +// docker-hub — Docker Hub (inecs) +// ssh-gitea-key — SSH к Gitea (push bump VERSION) +// gitea-jenkins-token — token Gitea (если нужен API; SCM обычно ssh-gitea-key) // // Версия: файл VERSION (+ pyproject / Helm). Теги образа: :, :, :latest // Deploy: devops-tools/wrapped/wrapped-deploy/main @@ -28,8 +29,8 @@ pipeline { RELEASE_TAG = "${env.GIT_COMMIT?.take(7) ?: 'dev'}" BUILDX_BUILDER = "jenkins-wrapped-${env.BUILD_NUMBER}" DEPLOY_JOB = 'devops-tools/wrapped/wrapped-deploy/main' - // SSH credential для git push bump (тот же ключ, что SCM Gitea) - GIT_SSH_CREDENTIALS_ID = 'gitea-ssh' + // SSH «Доступ к Gitea по SSH» — push bump-коммита VERSION + GIT_SSH_CREDENTIALS_ID = 'ssh-gitea-key' TZ = 'Europe/Moscow' } diff --git a/Jenkinsfile.deploy b/Jenkinsfile.deploy index 3752fee..0384b20 100644 --- a/Jenkinsfile.deploy +++ b/Jenkinsfile.deploy @@ -7,8 +7,8 @@ // Job: отдельный Multibranch Pipeline, Script Path = Jenkinsfile.deploy // Имя по умолчанию (см. DEPLOY_JOB в Jenkinsfile): «Devops Tools/Wrapped Deploy» // Триггер: вручную (Build with Parameters) или автоматически из Jenkinsfile после Build & push -// Credentials: -// k3s-kubeconfig — Secret file (kubeconfig), как у devops.org.ru +// Credentials (Global): +// k3s-kubeconfig — Secret file (kubeconfig к K3S) // // Agent: cloud kubernetes, label docker (pod template с container docker) // diff --git a/README.md b/README.md index 9603d6f..4f4597b 100644 --- a/README.md +++ b/README.md @@ -445,14 +445,17 @@ docker buildx build \ | `make push` | автоматически `bump-patch`, затем commit/push | | Jenkins (`Jenkinsfile`) | на `main` автоматически `bump-patch`, образ с новым тегом, commit `Bump version to X.Y.Z [skip ci].`, затем Deploy | -Коммиты с `[skip ci]` не бампят версию снова (анти-цикл). Credential для push bump: `GIT_SSH_CREDENTIALS_ID` (по умолчанию `gitea-ssh`) — тот же SSH-ключ, что для SCM. +Коммиты с `[skip ci]` не бампят версию снова (анти-цикл). Push bump VERSION — credential `ssh-gitea-key` (Доступ к Gitea по SSH). -Credentials (как в актуальном `Jenkinsfile`): +Credentials (Global, как в job’ах): | ID | Тип | Назначение | |----|-----|------------| -| `harbor-devops-tools-push-pull-access` | Username/password | Harbor `devops-tools` | -| `docker-hub` | Username/password | Docker Hub | +| `ssh-gitea-key` | SSH Username with private key | SCM + push bump VERSION | +| `gitea-jenkins-token` | Secret text / token | API Gitea (webhook/API при необходимости) | +| `harbor-devops-tools-push-pull-access` | Username/password | Harbor `devops-tools` (robot) | +| `docker-hub` | Username/password | Docker Hub `inecs` | +| `k3s-kubeconfig` | Secret file | Helm/kubectl deploy в K3S | Agent: label `docker` (pod template с container `docker` / DinD). @@ -487,9 +490,9 @@ kubectl -n wrapped rollout status deployment/wrapped | `IMAGE_TAG` | из `VERSION` / CI | SemVer образа (`Always` подтянет новый) | | `IMAGE_PULL_POLICY` | `Always` | как в addon | -Credential: `k3s-kubeconfig` (Secret file) — тот же, что у devops.org.ru. +Credential: `k3s-kubeconfig` (Secret file) — kubeconfig к K3S. -Рекомендуемая связка job’ов уже в [`Jenkinsfile`](Jenkinsfile): после **Version** + **Build & push** стадия **Trigger deploy** вызывает `devops-tools/wrapped/wrapped-deploy/main` с актуальным SemVer (`wait: true`). Credential SSH для version-commit: `gitea-ssh` (или поменяй `GIT_SSH_CREDENTIALS_ID`). +Рекомендуемая связка job’ов уже в [`Jenkinsfile`](Jenkinsfile): после **Version** + **Build & push** стадия **Trigger deploy** вызывает `devops-tools/wrapped/wrapped-deploy/main` с актуальным SemVer (`wait: true`). Push VERSION: `ssh-gitea-key`. Ручной запуск Deploy: **Build with Parameters** (пустой `IMAGE_TAG` → `cat VERSION`).