Skip to content

Commit 9127e01

Browse files
Add semantic version as env value and move nvm command to dependencies Jenkinsfile
1 parent 099332d commit 9127e01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Jenkinsfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def isSuccess
55
def preDeployFrontStage
66
def preDeployBackStage
77
def vers
8+
def SEM_VERSION = ''
89
pipeline {
910
agent {
1011
label 'stage'
@@ -43,6 +44,7 @@ pipeline {
4344
steps {
4445
script {
4546
sh 'dotnet tool update --global GitVersion.Tool --version 5.12.0'
47+
sh 'nvm use 16'
4648

4749
}
4850
}
@@ -58,6 +60,7 @@ pipeline {
5860
sh "echo ${vers}"
5961
env.CODE_VERSION = readFile(file: 'version').trim()
6062
echo "${env.CODE_VERSION}"
63+
SEM_VERSION="${env.CODE_VERSION}"
6164
sh "npm version ${env.CODE_VERSION} --allow-same-version --no-git-tag-version"
6265
env.CODE_VERSION = "${env.CODE_VERSION}.${env.BUILD_NUMBER}"
6366
echo "${env.CODE_VERSION}"
@@ -75,7 +78,6 @@ pipeline {
7578
. "$NVM_DIR/nvm.sh"
7679
fi
7780
78-
nvm use 16
7981
8082
npm install
8183
@@ -238,7 +240,9 @@ pipeline {
238240
sh 'echo ${BRANCH_NAME}'
239241
sh "git checkout master"
240242
sh 'echo ${BRANCH_NAME}'
241-
sh "git merge release/${env.CODE_VERSION}"
243+
sh "git merge release/${env.SEM_VERSION}"
244+
sh "npm version ${env.SEM_VERSION} -m 'Upgrade to %s as part of release'"
245+
242246
sh "git push origin main"
243247

244248
}

0 commit comments

Comments
 (0)