@@ -23,8 +23,8 @@ if (params.MODE == "PROMOTE") {
23
23
// promotion operations after this block.
24
24
infrapool. agentSh ' git config --global --add safe.directory "$(pwd)"'
25
25
26
- // Copy Github Enterprise release to Github
27
- release. copyEnterpriseRelease(params. VERSION_TO_PROMOTE )
26
+ // Copy Github Enterprise release to Github
27
+ release. copyEnterpriseRelease(params. VERSION_TO_PROMOTE )
28
28
29
29
}
30
30
return
@@ -76,52 +76,79 @@ pipeline {
76
76
steps {
77
77
script {
78
78
// Request ExecutorV2 agents for 1 hour(s)
79
- INFRAPOOL_EXECUTORV2_AGENT_0 = getInfraPoolAgent. connected(type : " ExecutorV2" , quantity : 1 , duration : 1 )[0 ]
79
+ infrapool = getInfraPoolAgent. connected(type : " ExecutorV2" , quantity : 1 , duration : 1 )[0 ]
80
80
}
81
81
}
82
82
}
83
83
84
- stage( ' Validate Changelog ' ){
85
- // This stage validates the changelog in this repo.
84
+ // Generates a VERSION file based on the current build number and latest version in CHANGELOG.md
85
+ stage( ' Validate Changelog and set version ' ) {
86
86
steps {
87
87
script {
88
- INFRAPOOL_EXECUTORV2_AGENT_0 . agentSh ' ./validate.sh '
88
+ updateVersion(infrapool, " CHANGELOG.md " , " ${ BUILD_NUMBER } " )
89
89
}
90
90
}
91
91
}
92
92
93
93
// Generates a VERSION file based on the current build number and latest version in CHANGELOG.md
94
94
stage(' Validate changelog and set version' ) {
95
95
steps {
96
- updateVersion(INFRAPOOL_EXECUTORV2_AGENT_0 , " CHANGELOG.md" , " ${ BUILD_NUMBER} " )
96
+ updateVersion(infrapool , " CHANGELOG.md" , " ${ BUILD_NUMBER} " )
97
97
}
98
98
}
99
99
100
100
stage(" Build Docker Image" ){
101
101
steps {
102
102
script {
103
- INFRAPOOL_EXECUTORV2_AGENT_0 . agentSh ' ./build.sh'
103
+ infrapool . agentSh ' ./build.sh'
104
104
}
105
105
}
106
106
}
107
107
108
-
109
108
stage(' Test' ) {
110
109
steps {
111
110
script {
112
- INFRAPOOL_EXECUTORV2_AGENT_0 . agentSh ' ./test.sh'
111
+ infrapool . agentSh ' ./test.sh'
113
112
}
114
113
}
115
114
post {
116
115
always{
117
116
script {
118
- INFRAPOOL_EXECUTORV2_AGENT_0 . agentStash name : ' rspec_junit' , includes : ' rspec_junit.xml'
117
+ infrapool . agentStash name : ' rspec_junit' , includes : ' rspec_junit.xml'
119
118
unstash ' rspec_junit'
120
119
junit ' rspec_junit.xml'
121
120
}
122
121
}
123
122
}
124
123
}
124
+
125
+ stage(' Release' ) {
126
+ when {
127
+ expression {
128
+ MODE == " RELEASE"
129
+ }
130
+ }
131
+
132
+ steps {
133
+ script {
134
+ release(infrapool) { billOfMaterialsDirectory , assetDirectory ->
135
+ /* Publish release artifacts to all the appropriate locations
136
+ Copy any artifacts to assetDirectory on the infrapool node
137
+ to attach them to the Github release.
138
+
139
+ If your assets are on the infrapool node in the target
140
+ directory, use a copy like this:
141
+ infrapool.agentSh "cp target/* ${assetDirectory}"
142
+ Note That this will fail if there are no assets, add :||
143
+ if you want the release to succeed with no assets.
144
+
145
+ If your assets are in target on the main Jenkins agent, use:
146
+ infrapool.agentPut(from: 'target/', to: assetDirectory)
147
+ */
148
+ }
149
+ }
150
+ }
151
+ }
125
152
}
126
153
127
154
post {
0 commit comments