2019-05-15 16:14:44 -05:00
|
|
|
pipeline {
|
2019-07-03 12:41:31 -05:00
|
|
|
agent none
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
triggers {
|
|
|
|
pollSCM 'H/10 * * * *'
|
|
|
|
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
buildDiscarder(logRotator(numToKeepStr: '14'))
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
stages {
|
|
|
|
stage("Test") {
|
|
|
|
when {
|
|
|
|
anyOf {
|
|
|
|
branch 'master'
|
|
|
|
not { triggeredBy 'UpstreamCause' }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parallel {
|
|
|
|
stage("test: baseline") {
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'adoptopenjdk/openjdk8:latest'
|
2019-07-03 14:15:43 -05:00
|
|
|
label 'data'
|
2019-07-03 12:41:31 -05:00
|
|
|
args '-v $HOME:/tmp/jenkins-home'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
options { timeout(time: 30, unit: 'MINUTES') }
|
|
|
|
steps {
|
|
|
|
sh 'rm -rf ?'
|
2019-08-05 10:21:32 -05:00
|
|
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
|
2019-07-03 12:41:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Release to artifactory') {
|
|
|
|
when {
|
2019-07-19 11:59:52 -05:00
|
|
|
anyOf {
|
|
|
|
branch 'master'
|
|
|
|
not { triggeredBy 'UpstreamCause' }
|
|
|
|
}
|
2019-07-03 12:41:31 -05:00
|
|
|
}
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'adoptopenjdk/openjdk8:latest'
|
2019-07-03 14:15:43 -05:00
|
|
|
label 'data'
|
2019-07-03 12:41:31 -05:00
|
|
|
args '-v $HOME:/tmp/jenkins-home'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
options { timeout(time: 20, unit: 'MINUTES') }
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
environment {
|
|
|
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
steps {
|
|
|
|
sh 'rm -rf ?'
|
|
|
|
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-elasticsearch " +
|
|
|
|
"-Dartifactory.build-number=${BUILD_NUMBER} " +
|
2019-08-05 10:21:32 -05:00
|
|
|
'-Dmaven.test.skip=true clean deploy -U -B'
|
2019-07-03 12:41:31 -05:00
|
|
|
}
|
|
|
|
}
|
2019-07-19 11:59:52 -05:00
|
|
|
stage('Publish documentation') {
|
2019-07-03 12:41:31 -05:00
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'adoptopenjdk/openjdk8:latest'
|
2019-07-03 14:15:43 -05:00
|
|
|
label 'data'
|
2019-07-03 12:41:31 -05:00
|
|
|
args '-v $HOME:/tmp/jenkins-home'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
options { timeout(time: 20, unit: 'MINUTES') }
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
environment {
|
|
|
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
steps {
|
2019-07-19 11:59:52 -05:00
|
|
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
|
2019-07-03 12:41:31 -05:00
|
|
|
'-Dartifactory.server=https://repo.spring.io ' +
|
|
|
|
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
|
|
|
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
2019-07-19 11:59:52 -05:00
|
|
|
"-Dartifactory.distribution-repository=temp-private-local " +
|
2019-08-05 10:21:32 -05:00
|
|
|
'-Dmaven.test.skip=true clean deploy -U -B'
|
2019-07-03 12:41:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
|
2019-07-03 12:41:31 -05:00
|
|
|
post {
|
|
|
|
changed {
|
|
|
|
script {
|
|
|
|
slackSend(
|
|
|
|
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
|
|
|
|
channel: '#spring-data-dev',
|
|
|
|
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
|
|
|
|
emailext(
|
|
|
|
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
|
|
|
|
mimeType: 'text/html',
|
|
|
|
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
|
|
|
|
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-15 16:14:44 -05:00
|
|
|
}
|