1
- def projectProperties = [
2
- [$ class : ' BuildDiscarderProperty ' ,
3
- strategy : [$ class : ' LogRotator ' , numToKeepStr : ' 5 ' ]],
4
- pipelineTriggers([ cron(' @daily' )] )
5
- ]
6
- properties(projectProperties )
1
+ properties( [
2
+ buildDiscarder(logRotator( numToKeepStr : ' 10 ' )) ,
3
+ pipelineTriggers([
4
+ cron(' @daily' )
5
+ ]),
6
+ ] )
7
7
8
8
def SUCCESS = hudson.model.Result . SUCCESS . toString()
9
9
currentBuild. result = SUCCESS
10
10
11
11
try {
12
12
parallel check : {
13
13
stage(' Check' ) {
14
- node {
15
- checkout scm
16
- try {
17
- sh " ./gradlew clean check --refresh-dependencies --no-daemon"
18
- } catch (Exception e) {
19
- currentBuild. result = ' FAILED: check'
20
- throw e
21
- } finally {
22
- junit ' **/build/*-results/*.xml'
14
+ timeout(time : 30 , unit : ' MINUTES' ) {
15
+ node {
16
+ checkout scm
17
+ try {
18
+ sh ' ./gradlew clean check --no-daemon --refresh-dependencies'
19
+ }
20
+ catch (e) {
21
+ currentBuild. result = ' FAILED: check'
22
+ throw e
23
+ }
24
+ finally {
25
+ junit ' **/build/*-results/*.xml'
26
+ }
23
27
}
24
28
}
25
29
}
@@ -29,64 +33,78 @@ try {
29
33
node {
30
34
checkout scm
31
35
try {
32
- sh " ./gradlew clean springIoCheck -PplatformVersion=Cairo-BUILD-SNAPSHOT -PexcludeProjects='**/samples/**' --refresh-dependencies --no-daemon --stacktrace"
33
- } catch (Exception e) {
36
+ sh ' ./gradlew clean springIoCheck --stacktrace --no-daemon --refresh-dependencies -PplatformVersion=Cairo-BUILD-SNAPSHOT -PexcludeProjects=' ** / samples/ ** '
37
+ }
38
+ catch(e) {
34
39
currentBuild.result = ' FAILED : springio'
35
40
throw e
36
- } finally {
41
+ }
42
+ finally {
37
43
junit ' ** / build/ spring- io*- results/* .xml'
38
44
}
39
45
}
40
46
}
41
47
}
42
48
43
- if (currentBuild. result == ' SUCCESS' ) {
49
+ if (currentBuild.result == 'SUCCESS') {
44
50
parallel artifacts: {
45
51
stage('Deploy Artifacts') {
46
52
node {
47
53
checkout scm
48
- withCredentials([file(credentialsId : ' spring-signing-secring.gpg' , variable : ' SIGNING_KEYRING_FILE' )]) {
49
- withCredentials([string(credentialsId : ' spring-gpg-passphrase' , variable : ' SIGNING_PASSWORD' )]) {
50
- withCredentials([usernamePassword(credentialsId : ' oss-token' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USERNAME' )]) {
51
- withCredentials([usernamePassword(credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' , usernameVariable : ' ARTIFACTORY_USERNAME' , passwordVariable : ' ARTIFACTORY_PASSWORD' )]) {
52
- sh " ./gradlew deployArtifacts finalizeDeployArtifacts -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password='$SIGNING_PASSWORD ' -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies --no-daemon --stacktrace"
54
+ try {
55
+ withCredentials([file(credentialsId: 'spring-signing-secring.gpg', variable: 'SIGNING_KEYRING_FILE')]) {
56
+ withCredentials([string(credentialsId: 'spring-gpg-passphrase', variable: 'SIGNING_PASSWORD')]) {
57
+ withCredentials([usernamePassword(credentialsId: 'oss-token', passwordVariable: 'OSSRH_PASSWORD', usernameVariable: 'OSSRH_USERNAME')]) {
58
+ withCredentials([usernamePassword(credentialsId: '02bd1690-b54f-4c9f-819d-a77cb7a9822c', usernameVariable: 'ARTIFACTORY_USERNAME', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
59
+ sh './gradlew deployArtifacts finalizeDeployArtifacts --stacktrace --no-daemon --refresh-dependencies -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD'
60
+ }
53
61
}
54
62
}
55
63
}
56
64
}
65
+ catch (e) {
66
+ currentBuild.result = 'FAILED: artifacts'
67
+ throw e
68
+ }
57
69
}
58
70
}
59
71
},
60
72
docs: {
61
73
stage('Deploy Docs') {
62
74
node {
63
75
checkout scm
64
- withCredentials([file(credentialsId : ' docs.spring.io-jenkins_private_ssh_key' , variable : ' DEPLOY_SSH_KEY' )]) {
65
- sh " ./gradlew deployDocs -PdeployDocsSshKeyPath=$DEPLOY_SSH_KEY -PdeployDocsSshUsername=$SPRING_DOCS_USERNAME --refresh-dependencies --no-daemon --stacktrace"
76
+ try {
77
+ withCredentials([file(credentialsId: 'docs.spring.io-jenkins_private_ssh_key', variable: 'DEPLOY_SSH_KEY')]) {
78
+ sh './gradlew deployDocs --stacktrace --no-daemon --refresh-dependencies -PdeployDocsSshKeyPath=$DEPLOY_SSH_KEY -PdeployDocsSshUsername=$SPRING_DOCS_USERNAME'
79
+ }
80
+ }
81
+ catch (e) {
82
+ currentBuild.result = 'FAILED: docs'
83
+ throw e
66
84
}
67
85
}
68
86
}
69
87
}
70
88
}
71
- } finally {
89
+ }
90
+ finally {
72
91
def buildStatus = currentBuild.result
73
- def buildNotSuccess = ! SUCCESS . equals(buildStatus)
92
+ def buildNotSuccess = !SUCCESS.equals(buildStatus)
74
93
def lastBuildNotSuccess = !SUCCESS.equals(currentBuild.previousBuild?.result)
75
94
76
- if (buildNotSuccess || lastBuildNotSuccess) {
77
-
78
- stage(' Notifiy' ) {
95
+ if (buildNotSuccess || lastBuildNotSuccess) {
96
+ stage('Notify') {
79
97
node {
80
98
final def RECIPIENTS = [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']]
81
99
82
100
def subject = "${buildStatus}: Build ${env.JOB_NAME} ${env.BUILD_NUMBER} status is now ${buildStatus}"
83
- def details = """ The build status changed to ${ buildStatus} . For details see ${ env.BUILD_URL} "" "
101
+ def details = "The build status changed to ${buildStatus}. For details see ${env.BUILD_URL}"
84
102
85
- emailext (
86
- subject : subject,
87
- body : details,
88
- recipientProviders : RECIPIENTS ,
89
- to : " $SPRING_SESSION_TEAM_EMAILS "
103
+ emailext(
104
+ subject: subject,
105
+ body: details,
106
+ recipientProviders: RECIPIENTS,
107
+ to: "$SPRING_SESSION_TEAM_EMAILS"
90
108
)
91
109
}
92
110
}
0 commit comments