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'; } }