@@ -16,6 +16,9 @@ pipeline {
16
16
SLACK_CHANNEL = ' #apm-agent-java'
17
17
18
18
BRANCH_SPECIFIER = " ${ params.branch_specifier} "
19
+ SUFFIX_ARN_FILE = ' arn-file.md'
20
+ // RELEASE_AWS_LAMBDA_VERSION = '-ver-1-29-0'
21
+ // RELEASE_VERSION = '1.29.0'
19
22
}
20
23
options {
21
24
timeout(time : 3 , unit : ' HOURS' )
@@ -27,6 +30,7 @@ pipeline {
27
30
parameters {
28
31
string(name : ' branch_specifier' , defaultValue : ' stable' , description : " What branch to release from?" )
29
32
booleanParam(name : ' check_branch_ci_status' , defaultValue : true , description : " Check for failing tests in the given branch (if no stable branch)?" )
33
+ booleanParam(name : ' publish_aws_lambda' , defaultValue : true , description : " Whether to upload the AWS lambda" )
30
34
}
31
35
stages {
32
36
stage(' Initializing' ){
@@ -131,6 +135,7 @@ pipeline {
131
135
env. RELEASE_TAG = " v" + user_release_version
132
136
env. RELEASE_VERSION = user_release_version
133
137
env. BRANCH_DOT_X = user_release_version. substring(0 , user_release_version. indexOf(' .' ))+ ' .x'
138
+ env. RELEASE_AWS_LAMBDA_VERSION = ' -ver-' + user_release_version. replaceAll(' \\ .' , ' -' )
134
139
}
135
140
}
136
141
}
@@ -164,10 +169,43 @@ pipeline {
164
169
}
165
170
}
166
171
}
172
+ stage(' Publish AWS Lambda' ) {
173
+ when {
174
+ // expression { params.publish_aws_lambda }
175
+ expression { return false }
176
+ }
177
+ environment {
178
+ SOURCE_AWS_FILE = " elastic-apm-java-aws-lambda-layer-${ RELEASE_VERSION} .zip"
179
+ }
180
+ steps {
181
+ setEnvVar(' ELASTIC_LAYER_NAME' , " elastic-apm-java${ env.RELEASE_AWS_LAMBDA_VERSION} " )
182
+ withAWSEnv(secret : ' secret/observability-team/ci/service-account/apm-aws-lambda' , role_id : ' apm-vault-role-id' , secret_id : ' apm-vault-secret-id' ,
183
+ forceInstallation : true , version : ' 2.4.10' ) {
184
+ dir(" ${ BASE_DIR} " ){
185
+ dir (' elastic-apm-agent/target' ) {
186
+ // TODO: copy file from a google bucket
187
+ sh(label : ' fetch AWS lambda file' , script : " wget https://github.com/elastic/apm-agent-java/releases/download/v${ RELEASE_VERSION} /${ SOURCE_AWS_FILE} -O ${ SOURCE_AWS_FILE} " )
188
+ }
189
+ sh(label : ' make publish-in-all-aws-regions' , script : ' make -C .ci publish-in-all-aws-regions' )
190
+ sh(label : ' make create-arn-file' , script : ' make -C .ci create-arn-file' )
191
+ }
192
+ }
193
+ }
194
+ post {
195
+ always {
196
+ archiveArtifacts(allowEmptyArchive : true , artifacts : " ${ BASE_DIR} /.ci/${ SUFFIX_ARN_FILE} " )
197
+ }
198
+ }
199
+ }
167
200
stage(' Create GitHub release draft' ) {
201
+ when {
202
+ expression { return false }
203
+ }
168
204
steps {
169
205
dir(" ${ BASE_DIR} " ){
170
206
script {
207
+ def arnFile = " .ci/${ SUFFIX_ARN_FILE} "
208
+ setEnvVar(' ARN_CONTENT' , fileExists(arnFile) ? readFile(arnFile) : ' ' )
171
209
// Construct the URL with anchor for the release notes
172
210
// Ex: https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-1.x.html#release-notes-1.13.0
173
211
def finalUrl = " https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-${ BRANCH_DOT_X} .html#release-notes-${ RELEASE_VERSION} "
@@ -176,14 +214,17 @@ pipeline {
176
214
draft : true ,
177
215
tagName : " ${ RELEASE_TAG} " ,
178
216
releaseName : " Release ${ RELEASE_VERSION} " ,
179
- body : " [Release Notes for ${ RELEASE_VERSION} ](${ finalUrl} )" )
217
+ body : " [Release Notes for ${ RELEASE_VERSION} ](${ finalUrl} ) \n ${ ARN_CONTENT } " )
180
218
env. RELEASE_ID = ret[' id' ]
181
219
env. RELEASE_NOTES_URL = finalUrl
182
220
}
183
221
}
184
222
}
185
223
}
186
224
stage(' Wait for artifact to be available in Maven Central' ) {
225
+ when {
226
+ expression { return false }
227
+ }
187
228
steps {
188
229
dir(" ${ BASE_DIR} " ){
189
230
script {
@@ -199,6 +240,9 @@ pipeline {
199
240
}
200
241
}
201
242
stage(' Update Cloudfoundry' ) {
243
+ when {
244
+ expression { return false }
245
+ }
202
246
steps {
203
247
dir(" ${ BASE_DIR} " ){
204
248
sh(script : " .ci/release/update_cloudfoundry.sh ${ RELEASE_VERSION} " )
@@ -207,6 +251,9 @@ pipeline {
207
251
}
208
252
}
209
253
stage(' Publish release on GitHub' ) {
254
+ when {
255
+ expression { return false }
256
+ }
210
257
steps {
211
258
dir(" ${ BASE_DIR} " ){
212
259
waitUntil(initialRecurrencePeriod : 60000 ) {
@@ -222,6 +269,9 @@ pipeline {
222
269
}
223
270
}
224
271
stage(' Build and push Docker images' ) {
272
+ when {
273
+ expression { return false }
274
+ }
225
275
steps {
226
276
dir(" ${ BASE_DIR} " ){
227
277
// fetch agent artifact from remote repository
0 commit comments