Skip to content

Commit d75058a

Browse files
committed
DATAJDBC-376 - Polishing.
1 parent 6ba1863 commit d75058a

File tree

1 file changed

+106
-105
lines changed

1 file changed

+106
-105
lines changed

Jenkinsfile

Lines changed: 106 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,116 @@
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-
}
9+
options {
10+
disableConcurrentBuilds()
11+
buildDiscarder(logRotator(numToKeepStr: '14'))
12+
}
1313

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 -B'
35-
sh "chown -R 1001:1001 target"
36-
}
37-
}
38-
}
39-
}
40-
stage('Release to artifactory') {
41-
when {
42-
anyOf {
43-
branch 'master'
44-
not { triggeredBy 'UpstreamCause' }
45-
}
46-
}
47-
agent {
48-
docker {
49-
image 'adoptopenjdk/openjdk8:latest'
50-
label 'data'
51-
args '-v $HOME:/tmp/jenkins-home'
52-
}
53-
}
54-
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 -B'
36+
sh "chown -R 1001:1001 target"
37+
}
38+
}
39+
}
40+
}
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') }
5556

56-
environment {
57-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
58-
}
57+
environment {
58+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
59+
}
5960

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

85-
environment {
86-
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
87-
}
86+
environment {
87+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
88+
}
8889

89-
steps {
90-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
91-
'-Dartifactory.server=https://repo.spring.io ' +
92-
"-Dartifactory.username=${ARTIFACTORY_USR} " +
93-
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
94-
"-Dartifactory.distribution-repository=temp-private-local " +
95-
'-Dmaven.test.skip=true clean deploy -B'
96-
}
97-
}
98-
}
90+
steps {
91+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
92+
'-Dartifactory.server=https://repo.spring.io ' +
93+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
94+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
95+
"-Dartifactory.distribution-repository=temp-private-local " +
96+
'-Dmaven.test.skip=true clean deploy -B'
97+
}
98+
}
99+
}
99100

100-
post {
101-
changed {
102-
script {
103-
slackSend(
104-
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
105-
channel: '#spring-data-dev',
106-
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
107-
emailext(
108-
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
109-
mimeType: 'text/html',
110-
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
111-
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
112-
}
113-
}
114-
}
101+
post {
102+
changed {
103+
script {
104+
slackSend(
105+
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
106+
channel: '#spring-data-dev',
107+
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
108+
emailext(
109+
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
110+
mimeType: 'text/html',
111+
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
112+
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
113+
}
114+
}
115+
}
115116
}

0 commit comments

Comments
 (0)