@@ -68,35 +68,47 @@ pipeline {
6868 }
6969 }
7070
71- stage(' Release to artifactory ' ) {
71+ stage(' Deploy ' ) {
7272 when {
7373 beforeAgent(true )
7474 anyOf {
75- branch(pattern : " main|(\\ d\\ .\\ d\\ .x)" , comparator : " REGEXP" )
75+ branch(pattern : " main|(\\ d\\ .\\ d\\ .x)|v( \\ d \\ . \\ d \\ .d)| " , comparator : " REGEXP" )
7676 not { triggeredBy ' UpstreamCause' }
7777 }
7878 }
7979 agent {
80- label ' data'
80+ docker {
81+ image " harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-vault-openjdk17-vault:${ p['java.main.tag']} -${ p['docker.vault.version']} "
82+ args " ${ p['docker.java.inside.basic']} "
83+ }
8184 }
8285 options { timeout(time : 20 , unit : ' MINUTES' ) }
8386
8487 environment {
8588 ARTIFACTORY = credentials(" ${ p['artifactory.credentials']} " )
89+ SONATYPE = credentials(' oss-login' )
90+ KEYRING = credentials(' spring-signing-secring.gpg' )
91+ PASSPHRASE = credentials(' spring-gpg-passphrase' )
8692 }
8793
8894 steps {
8995 script {
90- docker. image(" harbor-repo.vmware.com/dockerhub-proxy-cache/springci/spring-vault-openjdk17-vault:${ p['java.main.tag']} -${ p['docker.vault.version']} " ). inside(p[' docker.java.inside.basic' ]) {
91- sh ' MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
92- ' -Dartifactory.server=https://repo.spring.io ' +
93- " -Dartifactory.username=${ ARTIFACTORY_USR} " +
94- " -Dartifactory.password=${ ARTIFACTORY_PSW} " +
95- " -Dartifactory.staging-repository=libs-snapshot-local " +
96- " -Dartifactory.build-name=spring-vault " +
97- " -Dartifactory.build-number=${ BUILD_NUMBER} " +
98- ' -Dmaven.test.skip=true clean deploy -U -B'
96+ PROJECT_VERSION = sh(
97+ script : " ci/version.sh" ,
98+ returnStdout : true
99+ ). trim()
100+
101+ RELEASE_TYPE = ' snapshot'
102+
103+ if (PROJECT_VERSION . matches(/ .*-RC[0-9]+$/ ) || PROJECT_VERSION . matches(/ .*-M[0-9]+$/ )) {
104+ RELEASE_TYPE = " milestone"
105+ } else if (PROJECT_VERSION . endsWith(' SNAPSHOT' )) {
106+ RELEASE_TYPE = ' snapshot'
107+ } else if (PROJECT_VERSION . matches(/ .*\. [0-9]+$/ )) {
108+ RELEASE_TYPE = ' release'
99109 }
110+
111+ sh " ci/deploy-${ RELEASE_TYPE} .sh"
100112 }
101113 }
102114 }
0 commit comments