|
1 | 1 | pipeline {
|
2 |
| - agent none |
| 2 | + agent none |
3 | 3 |
|
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 | + } |
8 | 8 |
|
9 |
| - options { |
10 |
| - disableConcurrentBuilds() |
11 |
| - buildDiscarder(logRotator(numToKeepStr: '14')) |
12 |
| - } |
| 9 | + options { |
| 10 | + disableConcurrentBuilds() |
| 11 | + buildDiscarder(logRotator(numToKeepStr: '14')) |
| 12 | + } |
13 | 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 '-v $HOME:/tmp/jenkins-home' |
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 clean dependency:list test -Dsort -B' |
35 |
| - } |
36 |
| - } |
37 |
| - } |
38 |
| - } |
39 |
| - stage('Release to artifactory') { |
40 |
| - when { |
41 |
| - anyOf { |
42 |
| - branch 'master' |
43 |
| - not { triggeredBy 'UpstreamCause' } |
44 |
| - } |
45 |
| - } |
46 |
| - agent { |
47 |
| - docker { |
48 |
| - image 'adoptopenjdk/openjdk8:latest' |
49 |
| - label 'data' |
50 |
| - args '-v $HOME:/tmp/jenkins-home' |
51 |
| - } |
52 |
| - } |
53 |
| - 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 '-v $HOME:/tmp/jenkins-home' |
| 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 clean dependency:list test -Dsort -B' |
| 35 | + } |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + stage('Release to artifactory') { |
| 40 | + when { |
| 41 | + anyOf { |
| 42 | + branch 'master' |
| 43 | + not { triggeredBy 'UpstreamCause' } |
| 44 | + } |
| 45 | + } |
| 46 | + agent { |
| 47 | + docker { |
| 48 | + image 'adoptopenjdk/openjdk8:latest' |
| 49 | + label 'data' |
| 50 | + args '-v $HOME:/tmp/jenkins-home' |
| 51 | + } |
| 52 | + } |
| 53 | + options { timeout(time: 20, unit: 'MINUTES') } |
54 | 54 |
|
55 |
| - environment { |
56 |
| - ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
57 |
| - } |
| 55 | + environment { |
| 56 | + ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
| 57 | + } |
58 | 58 |
|
59 |
| - steps { |
60 |
| - sh 'rm -rf ?' |
61 |
| - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + |
62 |
| - '-Dartifactory.server=https://repo.spring.io ' + |
63 |
| - "-Dartifactory.username=${ARTIFACTORY_USR} " + |
64 |
| - "-Dartifactory.password=${ARTIFACTORY_PSW} " + |
65 |
| - "-Dartifactory.staging-repository=libs-snapshot-local " + |
66 |
| - "-Dartifactory.build-name=spring-data-solr " + |
67 |
| - "-Dartifactory.build-number=${BUILD_NUMBER} " + |
68 |
| - '-Dmaven.test.skip=true clean deploy -B' |
69 |
| - } |
70 |
| - } |
71 |
| - stage('Publish documentation') { |
72 |
| - when { |
73 |
| - branch 'master' |
74 |
| - } |
75 |
| - agent { |
76 |
| - docker { |
77 |
| - image 'adoptopenjdk/openjdk8:latest' |
78 |
| - label 'data' |
79 |
| - args '-v $HOME:/tmp/jenkins-home' |
80 |
| - } |
81 |
| - } |
82 |
| - options { timeout(time: 20, unit: 'MINUTES') } |
| 59 | + steps { |
| 60 | + sh 'rm -rf ?' |
| 61 | + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + |
| 62 | + '-Dartifactory.server=https://repo.spring.io ' + |
| 63 | + "-Dartifactory.username=${ARTIFACTORY_USR} " + |
| 64 | + "-Dartifactory.password=${ARTIFACTORY_PSW} " + |
| 65 | + "-Dartifactory.staging-repository=libs-snapshot-local " + |
| 66 | + "-Dartifactory.build-name=spring-data-solr " + |
| 67 | + "-Dartifactory.build-number=${BUILD_NUMBER} " + |
| 68 | + '-Dmaven.test.skip=true clean deploy -B' |
| 69 | + } |
| 70 | + } |
| 71 | + stage('Publish documentation') { |
| 72 | + when { |
| 73 | + branch 'master' |
| 74 | + } |
| 75 | + agent { |
| 76 | + docker { |
| 77 | + image 'adoptopenjdk/openjdk8:latest' |
| 78 | + label 'data' |
| 79 | + args '-v $HOME:/tmp/jenkins-home' |
| 80 | + } |
| 81 | + } |
| 82 | + options { timeout(time: 20, unit: 'MINUTES') } |
83 | 83 |
|
84 |
| - environment { |
85 |
| - ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
86 |
| - } |
| 84 | + environment { |
| 85 | + ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c') |
| 86 | + } |
87 | 87 |
|
88 |
| - steps { |
89 |
| - sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + |
90 |
| - '-Dartifactory.server=https://repo.spring.io ' + |
91 |
| - "-Dartifactory.username=${ARTIFACTORY_USR} " + |
92 |
| - "-Dartifactory.password=${ARTIFACTORY_PSW} " + |
93 |
| - "-Dartifactory.distribution-repository=temp-private-local " + |
94 |
| - '-Dmaven.test.skip=true clean deploy -B' |
95 |
| - } |
96 |
| - } |
97 |
| - } |
| 88 | + steps { |
| 89 | + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + |
| 90 | + '-Dartifactory.server=https://repo.spring.io ' + |
| 91 | + "-Dartifactory.username=${ARTIFACTORY_USR} " + |
| 92 | + "-Dartifactory.password=${ARTIFACTORY_PSW} " + |
| 93 | + "-Dartifactory.distribution-repository=temp-private-local " + |
| 94 | + '-Dmaven.test.skip=true clean deploy -B' |
| 95 | + } |
| 96 | + } |
| 97 | + } |
98 | 98 |
|
99 |
| - post { |
100 |
| - changed { |
101 |
| - script { |
102 |
| - slackSend( |
103 |
| - color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', |
104 |
| - channel: '#spring-data-dev', |
105 |
| - message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") |
106 |
| - emailext( |
107 |
| - subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", |
108 |
| - mimeType: 'text/html', |
109 |
| - recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], |
110 |
| - body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") |
111 |
| - } |
112 |
| - } |
113 |
| - } |
| 99 | + post { |
| 100 | + changed { |
| 101 | + script { |
| 102 | + slackSend( |
| 103 | + color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', |
| 104 | + channel: '#spring-data-dev', |
| 105 | + message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") |
| 106 | + emailext( |
| 107 | + subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", |
| 108 | + mimeType: 'text/html', |
| 109 | + recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], |
| 110 | + body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") |
| 111 | + } |
| 112 | + } |
| 113 | + } |
114 | 114 | }
|
0 commit comments