DATAREDIS-1380 - Use parent 'artifactory' profile for snapshot releases.

This commit is contained in:
Greg Turnquist
2019-07-05 11:34:39 -05:00
parent 1bdf875d45
commit e9fb4c2c63
2 changed files with 25 additions and 47 deletions

32
Jenkinsfile vendored
View File

@@ -8,6 +8,7 @@ pipeline {
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
@@ -18,7 +19,7 @@ pipeline {
changeset "Makefile"
}
}
agent any
agent { label 'data' }
options { timeout(time: 20, unit: 'MINUTES') }
steps {
@@ -43,7 +44,8 @@ pipeline {
agent {
docker {
image 'springci/spring-data-openjdk8-with-redis-5.0:latest'
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
}
options { timeout(time: 30, unit: 'MINUTES') }
@@ -57,7 +59,7 @@ pipeline {
sh 'make start'
// Execute maven test
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean test -DrunLongTests=true -B'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean test -DrunLongTests=true -B'
// Capture resulting exit code from maven (pass/fail)
sh 'RESULT=\$?'
@@ -81,7 +83,8 @@ pipeline {
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
}
options { timeout(time: 20, unit: 'MINUTES') }
@@ -92,7 +95,14 @@ pipeline {
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
'-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=libs-snapshot-local " +
"-Dartifactory.build-name=spring-data-redis " +
"-Dartifactory.build-number=${BUILD_NUMBER} " +
'-Dmaven.test.skip=true clean deploy -B'
}
}
@@ -103,7 +113,8 @@ pipeline {
agent {
docker {
image 'adoptopenjdk/openjdk8:latest'
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
}
options { timeout(time: 20, unit: 'MINUTES') }
@@ -114,7 +125,14 @@ pipeline {
steps {
sh 'rm -rf ?'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
'-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.staging-repository=libs-snapshot-local " +
"-Dartifactory.build-name=spring-data-redis " +
"-Dartifactory.build-number=${BUILD_NUMBER} " +
'-Dmaven.test.skip=true clean deploy -B'
}
}
}

40
pom.xml
View File

@@ -291,46 +291,6 @@
</build>
<profiles>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.6.1</version>
<inherited>false</inherited>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<buildInfo>
<buildUrl>{{BUILD_URL}}</buildUrl>
</buildInfo>
<deployProperties>
<zip.name>spring-data-redis</zip.name>
<zip.displayname>spring-data-redis</zip.displayname>
<zip.deployed>false</zip.deployed>
<archives>*:*:*:*@zip</archives>
</deployProperties>
<publisher>
<contextUrl>https://repo.spring.io</contextUrl>
<username>{{ARTIFACTORY_USR}}</username>
<password>{{ARTIFACTORY_PSW}}</password>
<repoKey>libs-snapshot-local</repoKey>
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>