@@ -64,7 +64,6 @@ pipeline {
64
64
options { skipDefaultCheckout () }
65
65
stages{
66
66
stage(' Check oss.sonatype.org' ) {
67
- when {expression { return false }}
68
67
steps {
69
68
// If this fails, an exception should be thrown and execution will halt
70
69
dir(" ${ BASE_DIR} " ){
@@ -80,7 +79,6 @@ pipeline {
80
79
stage(' Check build status' ) {
81
80
when {
82
81
allOf {
83
- expression { return false }
84
82
expression { params. check_branch_ci_status }
85
83
expression { env. BRANCH_SPECIFIER != ' stable' }
86
84
}
@@ -95,7 +93,6 @@ pipeline {
95
93
}
96
94
}
97
95
stage(' Require confirmation that CHANGELOG.asciidoc has been updated' ) {
98
- when {expression { return false }}
99
96
steps {
100
97
input(message : """
101
98
Update CHANGELOG.asciidoc to reflect the new version release:
@@ -139,67 +136,30 @@ pipeline {
139
136
}
140
137
}
141
138
}
142
-
143
- // temporary allow to override version
144
- stage(' Set release version manually' ) {
145
- steps {
146
- dir(" ${ BASE_DIR} " ){
147
- script {
148
- def user_release_version = input(message : " Please enter version to release:" , parameters : [[
149
- $class : ' StringParameterDefinition' ,
150
- name : ' Release version' ,
151
- defaultValue : " " ,
152
- description : " Input release version without '-SNAPSHOT' suffix"
153
- ]])
154
-
155
- env. RELEASE_TAG = " v" + user_release_version
156
- env. RELEASE_VERSION = user_release_version
157
- env. BRANCH_DOT_X = user_release_version. substring(0 , user_release_version. indexOf(' .' ))+ ' .x'
158
- }
159
- }
160
- }
161
- }
162
-
163
139
stage(' Wait on internal CI' ) {
164
- when {expression { return false }}
165
140
steps {
166
141
notifyStatus(slackStatus : ' warning' , subject : " [${ env.REPO} ] Release ready to be pushed" ,
167
142
body : " Please go to (<${ env.BUILD_URL} input|here>) to approve or reject within 12 hours." )
168
143
input(message : " Start the release job on the internal CI. Click 'Proceed' once the job has succeeded or click 'Abort' if the release has failed and then manually undo the release." )
169
144
}
170
145
}
171
146
stage(' Nexus release' ) {
172
- when {expression { return false }}
173
147
steps {
174
148
notifyStatus(slackStatus : ' warning' , subject : " [${ env.REPO} ] Release ready to be published in Nexus" ,
175
149
body : " Please go to (<https://oss.sonatype.org/|here>) to proceed with the manual nexus release. Login details in LastPass" )
176
150
input(message : " Go to https://oss.sonatype.org and proceed with the steps to close and release the staging artifact." )
177
151
}
178
152
}
179
153
stage(' Major Branch create/update' ) {
180
- when {expression { return false }}
181
154
steps {
182
155
dir(" ${ BASE_DIR} " ) {
183
156
script {
157
+ sh(script : " .ci/release/update_major_branch.sh ${ RELEASE_VERSION} " )
158
+ gitPush(args : " -f ${ BRANCH_DOT_X} " )
159
+
184
160
def isMajor = env. RELEASE_VERSION . endsWith(" .0.0" )
185
161
if (isMajor) {
186
- // major release, create '.x' branch
187
- sh(label : " remote tag is fetched for local checkout" , script : " git fetch origin ${ RELEASE_TAG} " )
188
- sh(label : " create .x branch from ${ RELEASE_TAG} " , script : """
189
- git checkout ${ RELEASE_TAG} --force
190
- git checkout -b ${ BRANCH_DOT_X} --force""" )
191
- gitPush()
192
162
input message : " This was a major version release. Please update the conf.yml in the docs repo before continuing" , ok " Continue"
193
- } else {
194
- // minor release, force-update existing '.x' branch. any change applied to '.x' branch, for example to
195
- // fix doc or release notes should also have been applied to master/stable branch we are releasing from
196
- sh(label : " remote tag and branch are fetched for local checkout" , script : """
197
- git fetch origin ${ BRANCH_DOT_X}
198
- git fetch origin ${ RELEASE_TAG} """ )
199
- sh(label : " force-update .x branch from ${ RELEASE_TAG} " , script : """
200
- git checkout --track origin/${ BRANCH_DOT_X} --force
201
- git reset --hard origin/${ RELEASE_TAG} """ )
202
- gitPush(args : " -f ${ BRANCH_DOT_X} " )
203
163
}
204
164
}
205
165
}
@@ -228,10 +188,9 @@ pipeline {
228
188
steps {
229
189
dir(" ${ BASE_DIR} " ){
230
190
script {
231
- def fullUrl = " https://repo1.maven.org/maven2/co/elastic/apm/elastic-apm-agent/${ RELEASE_VERSION} /elastic-apm-agent-${ RELEASE_VERSION} .pom"
232
191
waitUntil(initialRecurrencePeriod : 60000 ) {
233
192
script {
234
- def ret = sh(script : " curl -fs ' ${ fullUrl } ' >/dev/null 2>&1 " , returnStatus : true )
193
+ def ret = sh(script : " .ci/release/wait_maven_artifact_published.sh ${ RELEASE_VERSION } " , returnStatus : true )
235
194
echo " Waiting for the artifacts to be published on Sonatype"
236
195
return ret == 0
237
196
}
@@ -243,12 +202,7 @@ pipeline {
243
202
stage(' Update Cloudfoundry' ) {
244
203
steps {
245
204
dir(" ${ BASE_DIR} " ){
246
- // ensure that we don't rely on side effect of another step
247
- sh(label : " restore to previous updating version" , script : """
248
- git fetch origin master
249
- git checkout master
250
- git reset --hard origin/master""" )
251
- sh(script : " ./scripts/jenkins/update_cloudfoundry.sh ${ RELEASE_VERSION} " )
205
+ sh(script : " .ci/release/update_cloudfoundry.sh ${ RELEASE_VERSION} " )
252
206
gitPush()
253
207
}
254
208
}
@@ -259,7 +213,7 @@ pipeline {
259
213
waitUntil(initialRecurrencePeriod : 60000 ) {
260
214
script {
261
215
echo " Waiting for the release notes to be available"
262
- def ret = sh(script : " curl -fs https://www.elastic.co/guide/en/apm/agent/java/current/ release-notes- ${ BRANCH_DOT_X } .html | grep ${ RELEASE_VERSION} " , returnStatus : true )
216
+ def ret = sh(script : " .ci/ release/wait_release_notes_published.sh ${ RELEASE_VERSION} " , returnStatus : true )
263
217
return ret == 0
264
218
}
265
219
}
@@ -282,7 +236,7 @@ pipeline {
282
236
}
283
237
post {
284
238
success {
285
- notifyStatus(slackStatus : ' good' , subject : " [${ env.REPO} ] Release published" , body : " Great news! The release has completed successfully. (<${ env.RUN_DISPLAY_URL} |Open>)." )
239
+ notifyStatus(slackStatus : ' good' , subject : " [${ env.REPO} ] Release published" , body : " Great news! The release ${ env.RELEASE_VERSION } has completed successfully. (<${ env.RUN_DISPLAY_URL} |Open>)." )
286
240
}
287
241
}
288
242
}
0 commit comments