From 1e002a3e37013058812be4a7dc62c13909dc4573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=A2=D0=BE=D0=BB?= =?UTF-8?q?=D1=81=D1=82=D1=8B=D1=85?= Date: Fri, 30 Jan 2026 19:37:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8B=D1=87=D0=BB=D0=B5=D0=BD=D0=B8=D1=82=D1=8C=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D1=8E=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7?= =?UTF-8?q?=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 668901b..6115c80 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,23 +18,20 @@ pipeline { stage('Extract VERSION') { steps { script { - def versionFile = "src/main/resources/META-INF/ncore-product/${env.PRODUCT_GROUP}/version.properties" - if (!fileExists(versionFile)) - error "Version file not found: ${versionFile}" - def versionText = "" - readFile(file: versionFile).readLines().each { - if (it.contains('version')) - versionText += it.trim(); - } - echo versionText - def m = (versionText =~ /^version=(((\d+\.)*\d+)(?:-[A-Za-z]+)?)$/) + env.VERSION = sh( + script: """ + set -e + VERSION=\$(sed -n 's/^version=//p' ${versionFile}) - if (!m.find()) { - error "Invalid version format: ${versionText}" - } + if [[ ! "\$VERSION" =~ ^[0-9]+(\\.[0-9]+)*(-[A-Za-z]+)?$ ]]; then + echo "Invalid version format: \$VERSION" >&2 + exit 1 + fi - env.VERSION = m.group(1) - echo "Extracted VERSION: ${env.VERSION}" + echo "\$VERSION" + """, + returnStdout: true + ).trim() } } }