From 8124bd6446d25903069f8c0acdeb6df1f9cbd046 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: Thu, 24 Dec 2020 19:46:47 +0300 Subject: [PATCH] prod-max --- build/prod/Jenkinsfile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/build/prod/Jenkinsfile b/build/prod/Jenkinsfile index 29e1eb9..95e6ad9 100644 --- a/build/prod/Jenkinsfile +++ b/build/prod/Jenkinsfile @@ -1,4 +1,17 @@ stage ('production build') { - sh 'npm run build:prod'; - sh 'ls dist'; + 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:prod"; + } else { + echo 'tag not found' + sh "VERSION=master npm run build:prod" + } + + sh 'ls dist'; + } }