Skip to content

Commit 325dea9

Browse files
authored
fixed tag version number derivation for publishing draft release (#433)
1 parent 1ab5c59 commit 325dea9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Jenkinsfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ pipeline {
114114
}
115115
failure {
116116
mail to: "${env.WIT_BUILD_NOTIFICATION_EMAIL_TO}", from: 'noreply@oracle.com',
117-
subject: "WebLogic Image Tool: ${env.JOB_NAME} - Failed",
118-
body: "Job Failed - \"${env.JOB_NAME}\" build: ${env.BUILD_NUMBER}\n\nView the log at:\n ${env.BUILD_URL}\n"
117+
subject: "WebLogic Image Tool: ${env.JOB_NAME} - Failed",
118+
body: "Job Failed - \"${env.JOB_NAME}\" build: ${env.BUILD_NUMBER}\n\nView the log at:\n ${env.BUILD_URL}\n"
119119
}
120120
}
121121
}
@@ -137,9 +137,12 @@ pipeline {
137137
tag 'release-*'
138138
}
139139
steps {
140+
script {
141+
env.TAG_VERSION_NUMBER = env.TAG_NAME.replaceAll('release-','').trim()
142+
}
143+
140144
sh """
141145
echo '${env.GITHUB_API_TOKEN}' | ${GH_TOOL}/bin/gh auth login --with-token
142-
TAG_VERSION_NUMBER=sh("echo ${TAG_NAME} | sed 's/release-//'"), returnStdout: true).trim(),
143146
${GH_TOOL}/bin/gh release create ${TAG_NAME} \
144147
--draft \
145148
--generate-notes \
@@ -149,7 +152,7 @@ pipeline {
149152
"""
150153
}
151154
}
152-
}
155+
}
153156
}
154157

155158
void runSonarScanner() {
@@ -165,7 +168,7 @@ void runSonarScanner() {
165168
-Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} \
166169
-Dsonar.pullrequest.base=${env.CHANGE_TARGET}"
167170
} else {
168-
sh "mvn -B sonar:sonar \
171+
sh "mvn -B sonar:sonar \
169172
-Dsonar.projectKey=${org}_${repo} \
170173
-Dsonar.branch.name=${env.BRANCH_NAME}"
171174
}

0 commit comments

Comments
 (0)