From 2fb42d3d7a618852a1ca98edec53fc7bb77461bd Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Mon, 27 Jul 2026 23:32:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20RELEASE=5FTAG:=20=D0=B2=D1=8B=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B5=20checkout,=20=D0=B0=20=D0=BD=D0=B5=20=D0=B2=20env?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20agent=20none.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f8f319..5d94767 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { HARBOR_REGISTRY = 'hub.antropoff.ru' HARBOR_IMAGE = 'hub.antropoff.ru/devops-tools/wrapped' DOCKERHUB_IMAGE = 'inecs/wrapped' - RELEASE_TAG = "${env.GIT_COMMIT?.take(7) ?: 'dev'}" + // RELEASE_TAG — после checkout (с agent none GIT_COMMIT ещё нет → валидация env падает) BUILDX_BUILDER = "jenkins-wrapped-${env.BUILD_NUMBER}" DEPLOY_JOB = 'devops-tools/wrapped/wrapped-deploy/main' TZ = 'Europe/Moscow' @@ -62,7 +62,15 @@ pipeline { if (!env.IMAGE_VERSION) { error('VERSION file is empty') } + env.RELEASE_TAG = sh( + script: 'git rev-parse --short=7 HEAD', + returnStdout: true + ).trim() + if (!env.RELEASE_TAG) { + error('could not resolve short git SHA for RELEASE_TAG') + } echo "IMAGE_VERSION from VERSION → ${env.IMAGE_VERSION}" + echo "RELEASE_TAG → ${env.RELEASE_TAG}" } } }