94 lines
2.8 KiB
Groovy
94 lines
2.8 KiB
Groovy
pipeline {
|
|
agent none
|
|
|
|
triggers {
|
|
pollSCM 'H/10 * * * *'
|
|
upstream(upstreamProjects: "spring-data-commons/2.4.x,spring-data-cassandra/3.1.x,spring-data-couchbase/4.1.x,spring-data-elasticsearch/4.1.x" +
|
|
"spring-data-geode/2.4.x,spring-data-jpa/2.4.x,spring-data-ldap/2.4.x,spring-data-mongodb/3.1.x,spring-data-neo4j/6.0.x,spring-data-redis/2.4.x,spring-data-solr/2.4.x", threshold: hudson.model.Result.SUCCESS)
|
|
}
|
|
|
|
options {
|
|
disableConcurrentBuilds()
|
|
buildDiscarder(logRotator(numToKeepStr: '7'))
|
|
}
|
|
|
|
stages {
|
|
stage('Verify BOM Dependencies') {
|
|
when {
|
|
anyOf {
|
|
branch '2020.0.x'
|
|
not { triggeredBy 'UpstreamCause' }
|
|
}
|
|
}
|
|
agent {
|
|
label 'data'
|
|
}
|
|
options { timeout(time: 20, unit: 'MINUTES') }
|
|
|
|
environment {
|
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
|
|
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
|
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pwith-bom-client verify -B -U'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Build project and release to artifactory') {
|
|
when {
|
|
anyOf {
|
|
branch '2020.0.x'
|
|
not { triggeredBy 'UpstreamCause' }
|
|
}
|
|
}
|
|
agent {
|
|
label 'data'
|
|
}
|
|
options { timeout(time: 20, unit: 'MINUTES') }
|
|
|
|
environment {
|
|
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
|
|
docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
|
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Partifactory ' +
|
|
'-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-bom " +
|
|
"-Dartifactory.build-number=${BUILD_NUMBER} " +
|
|
'-Dmaven.test.skip=true clean deploy -B -U'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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>")
|
|
}
|
|
}
|
|
}
|
|
}
|