Migrate to new sonatype infrastructure.
This commit is contained in:
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@@ -106,19 +106,15 @@ pipeline {
|
|||||||
|
|
||||||
environment {
|
environment {
|
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||||
SONATYPE = credentials('oss-token')
|
SONATYPE = credentials('oss-login')
|
||||||
KEYRING = credentials('spring-signing-secring.gpg')
|
KEYRING = credentials('spring-signing-secring.gpg')
|
||||||
PASSPHRASE = credentials('spring-gpg-passphrase')
|
PASSPHRASE = credentials('spring-gpg-passphrase')
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Warm up this plugin quietly before using it.
|
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -q org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version'
|
|
||||||
|
|
||||||
// Extract project's version number
|
|
||||||
PROJECT_VERSION = sh(
|
PROJECT_VERSION = sh(
|
||||||
script: 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -o | grep -v INFO',
|
script: "ci/version.sh",
|
||||||
returnStdout: true
|
returnStdout: true
|
||||||
).trim()
|
).trim()
|
||||||
|
|
||||||
@@ -134,6 +130,12 @@ pipeline {
|
|||||||
|
|
||||||
if (RELEASE_TYPE == 'release') {
|
if (RELEASE_TYPE == 'release') {
|
||||||
sh "PROFILE=central USERNAME=${SONATYPE_USR} PASSWORD=${SONATYPE_PSW} ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION}"
|
sh "PROFILE=central USERNAME=${SONATYPE_USR} PASSWORD=${SONATYPE_PSW} ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION}"
|
||||||
|
|
||||||
|
slackSend(
|
||||||
|
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
|
||||||
|
channel: '#spring-session-bot',
|
||||||
|
message: "@here Spring Session for MongoDB ${PROJECT_VERSION} is staged on Sonatype awaiting closure and release.")
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sh "PROFILE=${RELEASE_TYPE} ci/build-and-deploy-to-artifactory.sh"
|
sh "PROFILE=${RELEASE_TYPE} ci/build-and-deploy-to-artifactory.sh"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,5 @@ MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
|
|||||||
-Dmaven.test.skip=true \
|
-Dmaven.test.skip=true \
|
||||||
-Dgpg.passphrase=${PASSPHRASE} \
|
-Dgpg.passphrase=${PASSPHRASE} \
|
||||||
-Dgpg.secretKeyring=${GNUPGHOME}/secring.gpg \
|
-Dgpg.secretKeyring=${GNUPGHOME}/secring.gpg \
|
||||||
-DstagingDescription="Releasing ${PROJECT_VERSION}" \
|
-DstagingDescription="Releasing Spring Session for MongoDB ${PROJECT_VERSION}" \
|
||||||
clean deploy -B
|
clean deploy -B
|
||||||
14
ci/version.sh
Executable file
14
ci/version.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
RAW_VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
|
||||||
|
org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
|
||||||
|
-Dexpression=project.version -q -DforceStdout`
|
||||||
|
|
||||||
|
# Split things up
|
||||||
|
VERSION_PARTS=($RAW_VERSION)
|
||||||
|
|
||||||
|
# Grab the last part, which is the actual version number.
|
||||||
|
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}
|
||||||
|
|
||||||
8
pom.xml
8
pom.xml
@@ -582,10 +582,10 @@
|
|||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<serverId>sonatype</serverId>
|
<serverId>sonatype</serverId>
|
||||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
|
||||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
<autoReleaseAfterClose>false</autoReleaseAfterClose>
|
||||||
<keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
|
<keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
|
||||||
<skipStagingRepositoryClose>false</skipStagingRepositoryClose>
|
<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
@@ -626,7 +626,7 @@
|
|||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
<url>https://s01.oss.sonatype.org//service/local/staging/deploy/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user