Skip to content

Commit 3acb4dc

Browse files
committed
[RelEng] Include release in name of deployment to Maven Central Portal
This simplifies distinguishing deployments in case more than one was done recently.
1 parent 2683902 commit 3acb4dc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

JenkinsJobs/Releng/deployToMaven.jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ pipeline {
161161
'''
162162
script {
163163
if ("${DEPLOYMENT_TYPE}" == 'release') {
164+
def repoTag = "${sourceRepository}".trim()
165+
if (repoTag.endsWith('/')) {
166+
repoTag = repoTag.substring(0, repoTag.length() - 1)
167+
}
168+
env.REPO_TAG = repoTag.substring(repoTag.lastIndexOf('/') + 1, repoTag.length())
169+
164170
// Documentation of the Central Portal Publisher API
165171
// - https://central.sonatype.org/publish/publish-portal-api
166172
// - https://central.sonatype.com/api-doc
@@ -172,7 +178,7 @@ pipeline {
172178
--header 'accept: text/plain' \
173179
--header 'Content-Type: multipart/form-data' \
174180
--form "bundle=@${PROJECT}-artifacts.zip" \
175-
'https://central.sonatype.com/api/v1/publisher/upload?publishingType=USER_MANAGED'
181+
"https://central.sonatype.com/api/v1/publisher/upload?name=${PROJECT^^}_${REPO_TAG}&publishingType=USER_MANAGED"
176182
''')
177183
writeFile(file: "${WORKSPACE}/deploymentId-${PROJECT}.txt", text: "${deploymentId}")
178184
waitUntil(initialRecurrencePeriod: 5_000) {

0 commit comments

Comments
 (0)