1 changed files with 168 additions and 168 deletions
@ -1,184 +1,184 @@ |
|||||||
pipeline { |
pipeline { |
||||||
agent none |
agent none |
||||||
|
|
||||||
triggers { |
triggers { |
||||||
pollSCM 'H/10 * * * *' |
pollSCM 'H/10 * * * *' |
||||||
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS) |
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS) |
||||||
} |
} |
||||||
|
|
||||||
options { |
options { |
||||||
disableConcurrentBuilds() |
disableConcurrentBuilds() |
||||||
buildDiscarder(logRotator(numToKeepStr: '14')) |
buildDiscarder(logRotator(numToKeepStr: '14')) |
||||||
} |
} |
||||||
|
|
||||||
stages { |
stages { |
||||||
stage("Docker images") { |
stage("Docker images") { |
||||||
parallel { |
parallel { |
||||||
stage('Publish JDK 8 + MongoDB 4.0') { |
stage('Publish JDK 8 + MongoDB 4.0') { |
||||||
when { |
when { |
||||||
changeset "ci/openjdk8-mongodb-4.0/**" |
changeset "ci/openjdk8-mongodb-4.0/**" |
||||||
} |
} |
||||||
agent { label 'data' } |
agent { label 'data' } |
||||||
options { timeout(time: 30, unit: 'MINUTES') } |
options { timeout(time: 30, unit: 'MINUTES') } |
||||||
|
|
||||||
steps { |
steps { |
||||||
script { |
script { |
||||||
def image = docker.build("springci/spring-data-openjdk8-with-mongodb-4.0", "ci/openjdk8-mongodb-4.0/") |
def image = docker.build("springci/spring-data-openjdk8-with-mongodb-4.0", "ci/openjdk8-mongodb-4.0/") |
||||||
docker.withRegistry('', 'hub.docker.com-springbuildmaster') { |
docker.withRegistry('', 'hub.docker.com-springbuildmaster') { |
||||||
image.push() |
image.push() |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
stage('Publish JDK 8 + MongoDB 4.1') { |
stage('Publish JDK 8 + MongoDB 4.1') { |
||||||
when { |
when { |
||||||
changeset "ci/openjdk8-mongodb-4.1/**" |
changeset "ci/openjdk8-mongodb-4.1/**" |
||||||
} |
} |
||||||
agent { label 'data' } |
agent { label 'data' } |
||||||
options { timeout(time: 30, unit: 'MINUTES') } |
options { timeout(time: 30, unit: 'MINUTES') } |
||||||
|
|
||||||
steps { |
steps { |
||||||
script { |
script { |
||||||
def image = docker.build("springci/spring-data-openjdk8-with-mongodb-4.1", "ci/openjdk8-mongodb-4.1/") |
def image = docker.build("springci/spring-data-openjdk8-with-mongodb-4.1", "ci/openjdk8-mongodb-4.1/") |
||||||
docker.withRegistry('', 'hub.docker.com-springbuildmaster') { |
docker.withRegistry('', 'hub.docker.com-springbuildmaster') { |
||||||
image.push() |
image.push() |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
stage("test: baseline") { |
stage("test: baseline") { |
||||||
when { |
when { |
||||||
anyOf { |
anyOf { |
||||||
branch 'master' |
branch 'master' |
||||||
not { triggeredBy 'UpstreamCause' } |
not { triggeredBy 'UpstreamCause' } |
||||||
} |
} |
||||||
} |
} |
||||||
agent { |
agent { |
||||||
docker { |
docker { |
||||||
image 'springci/spring-data-openjdk8-with-mongodb-4.0:latest' |
image 'springci/spring-data-openjdk8-with-mongodb-4.0:latest' |
||||||
label 'data' |
label 'data' |
||||||
args '-v $HOME:/tmp/jenkins-home' |
args '-v $HOME:/tmp/jenkins-home' |
||||||
} |
} |
||||||
} |
} |
||||||
options { timeout(time: 30, unit: 'MINUTES') } |
options { timeout(time: 30, unit: 'MINUTES') } |
||||||
steps { |
steps { |
||||||
sh 'rm -rf ?' |
sh 'rm -rf ?' |
||||||
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' |
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' |
||||||
sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' |
sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' |
||||||
sh 'sleep 10' |
sh 'sleep 10' |
||||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' |
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' |
||||||
sh 'sleep 15' |
sh 'sleep 15' |
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' |
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
stage("Test other configurations") { |
stage("Test other configurations") { |
||||||
when { |
when { |
||||||
anyOf { |
anyOf { |
||||||
branch 'master' |
branch 'master' |
||||||
not { triggeredBy 'UpstreamCause' } |
not { triggeredBy 'UpstreamCause' } |
||||||
} |
} |
||||||
} |
} |
||||||
parallel { |
parallel { |
||||||
stage("test: mongodb 4.1") { |
stage("test: mongodb 4.1") { |
||||||
agent { |
agent { |
||||||
docker { |
docker { |
||||||
image 'springci/spring-data-openjdk8-with-mongodb-4.1:latest' |
image 'springci/spring-data-openjdk8-with-mongodb-4.1:latest' |
||||||
label 'data' |
label 'data' |
||||||
args '-v $HOME:/tmp/jenkins-home' |
args '-v $HOME:/tmp/jenkins-home' |
||||||
} |
} |
||||||
} |
} |
||||||
options { timeout(time: 30, unit: 'MINUTES') } |
options { timeout(time: 30, unit: 'MINUTES') } |
||||||
steps { |
steps { |
||||||
sh 'rm -rf ?' |
sh 'rm -rf ?' |
||||||
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' |
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' |
||||||
sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' |
sh 'mongod --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' |
||||||
sh 'sleep 10' |
sh 'sleep 10' |
||||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' |
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' |
||||||
sh 'sleep 15' |
sh 'sleep 15' |
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' |
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B' |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
stage('Release to artifactory') { |
stage('Release to artifactory') { |
||||||
when { |
when { |
||||||
anyOf { |
anyOf { |
||||||
branch 'master' |
branch 'master' |
||||||
not { triggeredBy 'UpstreamCause' } |
not { triggeredBy 'UpstreamCause' } |
||||||
} |
} |
||||||
} |
} |
||||||
agent { |
agent { |
||||||
docker { |
docker { |
||||||
image 'adoptopenjdk/openjdk8:latest' |
image 'adoptopenjdk/openjdk8:latest' |
||||||
label 'data' |
label 'data' |
||||||
args '-v $HOME:/tmp/jenkins-home' |
args '-v $HOME:/tmp/jenkins-home' |
||||||
} |
} |
||||||
} |
} |
||||||
options { timeout(time: 20, unit: 'MINUTES') } |
options { timeout(time: 20, unit: 'MINUTES') } |
||||||
|
|
||||||
environment { |
environment { |
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
||||||
} |
} |
||||||
|
|
||||||
steps { |
steps { |
||||||
sh 'rm -rf ?' |
sh 'rm -rf ?' |
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + |
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + |
||||||
'-Dartifactory.server=https://repo.spring.io ' + |
'-Dartifactory.server=https://repo.spring.io ' + |
||||||
"-Dartifactory.username=${ARTIFACTORY_USR} " + |
"-Dartifactory.username=${ARTIFACTORY_USR} " + |
||||||
"-Dartifactory.password=${ARTIFACTORY_PSW} " + |
"-Dartifactory.password=${ARTIFACTORY_PSW} " + |
||||||
"-Dartifactory.staging-repository=libs-snapshot-local " + |
"-Dartifactory.staging-repository=libs-snapshot-local " + |
||||||
"-Dartifactory.build-name=spring-data-mongodb " + |
"-Dartifactory.build-name=spring-data-mongodb " + |
||||||
"-Dartifactory.build-number=${BUILD_NUMBER} " + |
"-Dartifactory.build-number=${BUILD_NUMBER} " + |
||||||
'-Dmaven.test.skip=true clean deploy -B' |
'-Dmaven.test.skip=true clean deploy -B' |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
stage('Publish documentation') { |
stage('Publish documentation') { |
||||||
when { |
when { |
||||||
branch 'master' |
branch 'master' |
||||||
} |
} |
||||||
agent { |
agent { |
||||||
docker { |
docker { |
||||||
image 'adoptopenjdk/openjdk8:latest' |
image 'adoptopenjdk/openjdk8:latest' |
||||||
label 'data' |
label 'data' |
||||||
args '-v $HOME:/tmp/jenkins-home' |
args '-v $HOME:/tmp/jenkins-home' |
||||||
} |
} |
||||||
} |
} |
||||||
options { timeout(time: 20, unit: 'MINUTES') } |
options { timeout(time: 20, unit: 'MINUTES') } |
||||||
|
|
||||||
environment { |
environment { |
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
||||||
} |
} |
||||||
|
|
||||||
steps { |
steps { |
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + |
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + |
||||||
'-Dartifactory.server=https://repo.spring.io ' + |
'-Dartifactory.server=https://repo.spring.io ' + |
||||||
"-Dartifactory.username=${ARTIFACTORY_USR} " + |
"-Dartifactory.username=${ARTIFACTORY_USR} " + |
||||||
"-Dartifactory.password=${ARTIFACTORY_PSW} " + |
"-Dartifactory.password=${ARTIFACTORY_PSW} " + |
||||||
"-Dartifactory.distribution-repository=temp-private-local " + |
"-Dartifactory.distribution-repository=temp-private-local " + |
||||||
'-Dmaven.test.skip=true clean deploy -B' |
'-Dmaven.test.skip=true clean deploy -B' |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
post { |
post { |
||||||
changed { |
changed { |
||||||
script { |
script { |
||||||
slackSend( |
slackSend( |
||||||
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', |
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', |
||||||
channel: '#spring-data-dev', |
channel: '#spring-data-dev', |
||||||
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") |
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") |
||||||
emailext( |
emailext( |
||||||
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", |
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", |
||||||
mimeType: 'text/html', |
mimeType: 'text/html', |
||||||
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], |
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], |
||||||
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") |
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue