From b266f186826ca67c6bf3ad317839c3c876054b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BC=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Tue, 23 Feb 2021 22:29:18 +0300 Subject: [PATCH] version=masterr on dev --- build/dev/Jenkinsfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/build/dev/Jenkinsfile b/build/dev/Jenkinsfile index 8428aac..2333f8c 100644 --- a/build/dev/Jenkinsfile +++ b/build/dev/Jenkinsfile @@ -1,7 +1,17 @@ stage ('build') { - try { - sh 'npm run build' - } catch (error) { - echo error + script { + def tag = sh(returnStdout: true, script: "git tag --contains").trim() + def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim() + + if (tag) { + echo 'found tag ' + tag + def tagNoV = tag.substring(1) + sh "VERSION=${tagNoV} npm run build"; + } else { + echo 'tag not found' + sh "VERSION=master npm run build" + } + + sh 'ls dist'; } }