Skip to content

Commit 412e851

Browse files
committed
#121 - Polishing.
1 parent dd18434 commit 412e851

File tree

1 file changed

+107
-106
lines changed

1 file changed

+107
-106
lines changed

Jenkinsfile

Lines changed: 107 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,118 @@
11
pipeline {
2-
agent none
2+
agent none
33

4-
triggers {
5-
pollSCM 'H/10 * * * *'
6-
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
7-
}
4+
triggers {
5+
pollSCM 'H/10 * * * *'
6+
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
7+
}
88

9-
options {
10-
disableConcurrentBuilds()
11-
buildDiscarder(logRotator(numToKeepStr: '14'))
12-
}
13-
14-
stages {
15-
stage("Test") {
16-
when {
17-
anyOf {
18-
branch 'master'
19-
not { triggeredBy 'UpstreamCause' }
20-
}
21-
}
22-
parallel {
23-
stage("test: baseline") {
24-
agent {
25-
docker {
26-
image 'adoptopenjdk/openjdk8:latest'
27-
label 'data'
28-
args '-u root -v /var/run/docker.sock:/var/run/docker.sock' // root but with no maven caching
29-
}
30-
}
31-
options { timeout(time: 30, unit: 'MINUTES') }
32-
steps {
33-
sh 'rm -rf ?'
34-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -Dbundlor.enabled=false -B'
35-
sh "chown -R 1001:1001 target"
36-
}
37-
}
38-
}
39-
}
9+
options {
10+
disableConcurrentBuilds()
11+
buildDiscarder(logRotator(numToKeepStr: '14'))
12+
}
4013

41-
stage('Release to artifactory') {
42-
when {
43-
anyOf {
44-
branch 'master'
45-
not { triggeredBy 'UpstreamCause' }
46-
}
47-
}
48-
agent {
49-
docker {
50-
image 'adoptopenjdk/openjdk8:latest'
51-
label 'data'
52-
args '-v $HOME:/tmp/jenkins-home'
53-
}
54-
}
55-
options { timeout(time: 20, unit: 'MINUTES') }
14+
stages {
15+
stage("Test") {
16+
when {
17+
anyOf {
18+
branch 'master'
19+
not { triggeredBy 'UpstreamCause' }
20+
}
21+
}
22+
parallel {
23+
stage("test: baseline") {
24+
agent {
25+
docker {
26+
image 'adoptopenjdk/openjdk8:latest'
27+
label 'data'
28+
args '-u root -v /var/run/docker.sock:/var/run/docker.sock'
29+
// root but with no maven caching
30+
}
31+
}
32+
options { timeout(time: 30, unit: 'MINUTES') }
33+
steps {
34+
sh 'rm -rf ?'
35+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,all-dbs clean dependency:list test -Dsort -Dbundlor.enabled=false -B'
36+
sh "chown -R 1001:1001 target"
37+
}
38+
}
39+
}
40+
}
5641

57-
environment {
58-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
59-
}
42+
stage('Release to artifactory') {
43+
when {
44+
anyOf {
45+
branch 'master'
46+
not { triggeredBy 'UpstreamCause' }
47+
}
48+
}
49+
agent {
50+
docker {
51+
image 'adoptopenjdk/openjdk8:latest'
52+
label 'data'
53+
args '-v $HOME:/tmp/jenkins-home'
54+
}
55+
}
56+
options { timeout(time: 20, unit: 'MINUTES') }
6057

61-
steps {
62-
sh 'rm -rf ?'
63-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
64-
'-Dartifactory.server=https://repo.spring.io ' +
65-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
66-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
67-
"-Dartifactory.staging-repository=libs-snapshot-local " +
68-
"-Dartifactory.build-name=spring-data-r2dbc " +
69-
"-Dartifactory.build-number=${BUILD_NUMBER} " +
70-
'-Dmaven.test.skip=true clean deploy -B'
71-
}
72-
}
58+
environment {
59+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
60+
}
7361

74-
stage('Publish documentation') {
75-
when {
76-
branch 'master'
77-
}
78-
agent {
79-
docker {
80-
image 'adoptopenjdk/openjdk8:latest'
81-
label 'data'
82-
args '-v $HOME:/tmp/jenkins-home'
83-
}
84-
}
85-
options { timeout(time: 20, unit: 'MINUTES') }
62+
steps {
63+
sh 'rm -rf ?'
64+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
65+
'-Dartifactory.server=https://repo.spring.io ' +
66+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
67+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
68+
"-Dartifactory.staging-repository=libs-snapshot-local " +
69+
"-Dartifactory.build-name=spring-data-r2dbc " +
70+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
71+
'-Dmaven.test.skip=true clean deploy -B'
72+
}
73+
}
8674

87-
environment {
88-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
89-
}
75+
stage('Publish documentation') {
76+
when {
77+
branch 'master'
78+
}
79+
agent {
80+
docker {
81+
image 'adoptopenjdk/openjdk8:latest'
82+
label 'data'
83+
args '-v $HOME:/tmp/jenkins-home'
84+
}
85+
}
86+
options { timeout(time: 20, unit: 'MINUTES') }
9087

91-
steps {
92-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
93-
'-Dartifactory.server=https://repo.spring.io ' +
94-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
95-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
96-
"-Dartifactory.distribution-repository=temp-private-local " +
97-
'-Dmaven.test.skip=true clean deploy -B'
98-
}
99-
}
100-
}
88+
environment {
89+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
90+
}
10191

102-
post {
103-
changed {
104-
script {
105-
slackSend(
106-
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
107-
channel: '#spring-data-dev',
108-
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
109-
emailext(
110-
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
111-
mimeType: 'text/html',
112-
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
113-
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
114-
}
115-
}
116-
}
92+
steps {
93+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
94+
'-Dartifactory.server=https://repo.spring.io ' +
95+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
96+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
97+
"-Dartifactory.distribution-repository=temp-private-local " +
98+
'-Dmaven.test.skip=true clean deploy -B'
99+
}
100+
}
101+
}
102+
103+
post {
104+
changed {
105+
script {
106+
slackSend(
107+
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
108+
channel: '#spring-data-dev',
109+
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
110+
emailext(
111+
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
112+
mimeType: 'text/html',
113+
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
114+
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
115+
}
116+
}
117+
}
117118
}

0 commit comments

Comments
 (0)