1+ def p = [:]
2+
3+ node {
4+ checkout scm
5+ p = readProperties interpolate : true , file : ' ci/pipeline.properties'
6+ }
7+
18pipeline {
29
310 agent any
411
5- /*
6- environment {
7- JAVA_HOME = "${tool 'jdk8'}"
8- }
9- */
10-
1112 options {
1213 buildDiscarder(logRotator(numToKeepStr : ' 15' ))
1314 disableConcurrentBuilds()
@@ -20,40 +21,35 @@ pipeline {
2021 stages {
2122
2223 stage(' Build' ) {
23- environment {
24- DOCKER_HUB = credentials(' hub.docker.com-springbuildmaster' )
25- }
2624 options {
2725 timeout(time : 15 , unit : " MINUTES" )
2826 }
2927 steps {
3028 script {
31- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
32- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(' -u root -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp' ) {
29+ docker. image(p[' docker.container.image.java.main' ]). inside(p[' docker.container.inside.env.full' ]) {
3330
34- sh " echo 'Setup build environment...'"
35- sh " ci/setup.sh"
31+ sh " echo 'Setup build environment...'"
32+ sh " ci/setup.sh"
3633
37- // Cleanup any prior build system resources
38- try {
39- sh " echo 'Clean up GemFire/Geode files & build artifacts...'"
40- sh " ci/cleanupGemFiles.sh"
41- sh " ci/cleanupArtifacts.sh"
42- }
43- catch (ignore) { }
34+ // Cleanup any prior build system resources
35+ try {
36+ sh " echo 'Clean up GemFire/Geode files & build artifacts...'"
37+ sh " ci/cleanupGemFiles.sh"
38+ sh " ci/cleanupArtifacts.sh"
39+ }
40+ catch (ignore) { }
4441
45- // Run the SBDG project Gradle build using JDK 8 inside Docker
46- try {
47- sh " echo 'Building SBDG...'"
48- sh " ci/check.sh"
49- }
50- catch (e) {
51- currentBuild. result = " FAILED: build"
52- throw e
53- }
54- finally {
55- junit ' **/build/test-results/*/*.xml'
56- }
42+ // Run the SBDG project Gradle build using JDK 8 inside Docker
43+ try {
44+ sh " echo 'Building SBDG...'"
45+ sh " ci/check.sh"
46+ }
47+ catch (e) {
48+ currentBuild. result = " FAILED: build"
49+ throw e
50+ }
51+ finally {
52+ junit ' **/build/test-results/*/*.xml'
5753 }
5854 }
5955 }
@@ -63,16 +59,14 @@ pipeline {
6359 stage (' Deploy Docs' ) {
6460 steps {
6561 script {
66- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
67- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} Two -u root -v /tmp:/tmp" ) {
68- withCredentials([file(credentialsId : ' docs.spring.io-jenkins_private_ssh_key' , variable : ' DEPLOY_SSH_KEY' )]) {
69- try {
70- sh " ci/deployDocs.sh"
71- }
72- catch (e) {
73- currentBuild. result = " FAILED: deploy docs"
74- throw e
75- }
62+ docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} Two -u root -v /tmp:/tmp" ) {
63+ withCredentials([file(credentialsId : ' docs.spring.io-jenkins_private_ssh_key' , variable : ' DEPLOY_SSH_KEY' )]) {
64+ try {
65+ sh " ci/deployDocs.sh"
66+ }
67+ catch (e) {
68+ currentBuild. result = " FAILED: deploy docs"
69+ throw e
7670 }
7771 }
7872 }
@@ -83,19 +77,17 @@ pipeline {
8377 stage (' Deploy Artifacts' ) {
8478 steps {
8579 script {
86- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
87- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} One -u root -v /tmp:/tmp" ) {
88- withCredentials([file(credentialsId : ' spring-signing-secring.gpg' , variable : ' SIGNING_KEYRING_FILE' )]) {
89- withCredentials([string(credentialsId : ' spring-gpg-passphrase' , variable : ' SIGNING_PASSWORD' )]) {
90- withCredentials([usernamePassword(credentialsId : ' oss-token' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USERNAME' )]) {
91- withCredentials([usernamePassword(credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' , usernameVariable : ' ARTIFACTORY_USERNAME' , passwordVariable : ' ARTIFACTORY_PASSWORD' )]) {
92- try {
93- sh " ci/deployArtifacts.sh"
94- }
95- catch (e) {
96- currentBuild. result = " FAILED: deploy artifacts"
97- throw e
98- }
80+ docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} One -u root -v /tmp:/tmp" ) {
81+ withCredentials([file(credentialsId : ' spring-signing-secring.gpg' , variable : ' SIGNING_KEYRING_FILE' )]) {
82+ withCredentials([string(credentialsId : ' spring-gpg-passphrase' , variable : ' SIGNING_PASSWORD' )]) {
83+ withCredentials([usernamePassword(credentialsId : ' oss-token' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USERNAME' )]) {
84+ withCredentials([usernamePassword(credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' , usernameVariable : ' ARTIFACTORY_USERNAME' , passwordVariable : ' ARTIFACTORY_PASSWORD' )]) {
85+ try {
86+ sh " ci/deployArtifacts.sh"
87+ }
88+ catch (e) {
89+ currentBuild. result = " FAILED: deploy artifacts"
90+ throw e
9991 }
10092 }
10193 }
0 commit comments