From 87b7a6d8f46d86c1c37ea76899bfb23317c9956d Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Mon, 27 Jul 2026 23:35:46 +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=20Version:=20IMAGE=5FVERSION/RELEASE=5FTAG=20?= =?UTF-8?q?=D0=B1=D0=B5=D0=B7=20git=20=D0=B2=20DinD=20(dubious=20ownership?= =?UTF-8?q?).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- Jenkinsfile | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d94767..a62f56f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,25 +53,18 @@ pipeline { stage('Version') { steps { - container('docker') { - script { - env.IMAGE_VERSION = sh( - script: "tr -d '[:space:]' < VERSION", - returnStdout: true - ).trim() - 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}" + script { + // Без git в DinD-контейнере: dubious ownership → exit 128 + env.IMAGE_VERSION = readFile('VERSION').trim() + if (!env.IMAGE_VERSION) { + error('VERSION file is empty') } + if (!env.GIT_COMMIT) { + error('GIT_COMMIT is empty after checkout') + } + env.RELEASE_TAG = env.GIT_COMMIT.take(7) + echo "IMAGE_VERSION from VERSION → ${env.IMAGE_VERSION}" + echo "RELEASE_TAG → ${env.RELEASE_TAG}" } } }