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
@@ -14,40 +21,35 @@ pipeline {
1421 stages {
1522
1623 stage(' Build' ) {
17- environment {
18- DOCKER_HUB = credentials(' hub.docker.com-springbuildmaster' )
19- }
2024 options {
2125 timeout(time : 15 , unit : " MINUTES" )
2226 }
2327 steps {
2428 script {
25- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
26- 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' ]) {
2730
28- sh " echo 'Setup build environment...'"
29- sh " ci/setup.sh"
31+ sh " echo 'Setup build environment...'"
32+ sh " ci/setup.sh"
3033
31- // Cleanup any prior build system resources
32- try {
33- sh " echo 'Clean up GemFire/Geode files & build artifacts...'"
34- sh " ci/cleanupGemFiles.sh"
35- sh " ci/cleanupArtifacts.sh"
36- }
37- 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) { }
3841
39- // Run the SBDG project Gradle build using JDK 8 inside Docker
40- try {
41- sh " echo 'Building SSDG...'"
42- sh " ci/check.sh"
43- }
44- catch (e) {
45- currentBuild. result = " FAILED: build"
46- throw e
47- }
48- finally {
49- junit ' **/build/test-results/*/*.xml'
50- }
42+ // Run the SBDG project Gradle build using JDK 8 inside Docker
43+ try {
44+ sh " echo 'Building SSDG...'"
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'
5153 }
5254 }
5355 }
@@ -57,16 +59,14 @@ pipeline {
5759 stage (' Deploy Docs' ) {
5860 steps {
5961 script {
60- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
61- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} Two -u root -v /tmp:/tmp" ) {
62- withCredentials([file(credentialsId : ' docs.spring.io-jenkins_private_ssh_key' , variable : ' DEPLOY_SSH_KEY' )]) {
63- try {
64- sh " ci/deployDocs.sh"
65- }
66- catch (e) {
67- currentBuild. result = " FAILED: deploy docs"
68- throw e
69- }
62+ docker. image(p[' docker.container.image.java.main' ]). inside(p[' docker.container.inside.env.basic' ]) {
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
7070 }
7171 }
7272 }
@@ -77,19 +77,17 @@ pipeline {
7777 stage (' Deploy Artifacts' ) {
7878 steps {
7979 script {
80- docker. withRegistry(' ' , ' hub.docker.com-springbuildmaster' ) {
81- docker. image(' adoptopenjdk/openjdk8:latest' ). inside(" --name ${ env.HOSTNAME} One -u root -v /tmp:/tmp" ) {
82- withCredentials([file(credentialsId : ' spring-signing-secring.gpg' , variable : ' SIGNING_KEYRING_FILE' )]) {
83- withCredentials([string(credentialsId : ' spring-gpg-passphrase' , variable : ' SIGNING_PASSWORD' )]) {
84- withCredentials([usernamePassword(credentialsId : ' oss-token' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USERNAME' )]) {
85- withCredentials([usernamePassword(credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' , usernameVariable : ' ARTIFACTORY_USERNAME' , passwordVariable : ' ARTIFACTORY_PASSWORD' )]) {
86- try {
87- sh " ci/deployArtifacts.sh"
88- }
89- catch (e) {
90- currentBuild. result = " FAILED: deploy artifacts"
91- throw e
92- }
80+ docker. image(p[' docker.container.image.java.main' ]). inside(p[' docker.container.inside.env.basic' ]) {
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
9391 }
9492 }
9593 }
0 commit comments