File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,19 @@ pipeline {
154
154
}
155
155
}
156
156
}
157
+ stage(' DeletePreviousLayer' ) {
158
+ steps {
159
+ withGithubNotify(context : " Delete-Layer-${ PLATFORM} " ) {
160
+ withGoEnv(){
161
+ withAWSEnv(secret : ' secret/observability-team/ci/service-account/apm-aws-lambda' , forceInstallation : true , version : ' 2.4.10' ) {
162
+ dir(" ${ BASE_DIR} " ){
163
+ cmd(label : ' make delete-in-all-aws-regions' , script : ' make delete-in-all-aws-regions' , returnStatus : true )
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
157
170
stage(' PublishLayer' ) {
158
171
steps {
159
172
withGithubNotify(context : " Publish-Layer-${ PLATFORM} " ) {
Original file line number Diff line number Diff line change @@ -115,6 +115,21 @@ publish: validate-layer-name validate-aws-default-region
115
115
--license " Apache-2.0" \
116
116
--zip-file " fileb://./bin/extension.zip"
117
117
118
+ # Delete the given LAYER in all the AWS regions
119
+ delete-in-all-aws-regions : validate-layer-name get-all-aws-regions
120
+ @mkdir -p $(AWS_FOLDER )
121
+ @while read AWS_DEFAULT_REGION; do \
122
+ echo " delete '$( ELASTIC_LAYER_NAME) -$( ARCHITECTURE) ' in $$ {AWS_DEFAULT_REGION}" ; \
123
+ AWS_DEFAULT_REGION=" $$ {AWS_DEFAULT_REGION}" ELASTIC_LAYER_NAME=$(ELASTIC_LAYER_NAME ) $(MAKE ) delete; \
124
+ done < .regions
125
+
126
+ # Delete the given LAYER in the given AWS region, it won't fail
127
+ delete : validate-layer-name validate-aws-default-region
128
+ @aws lambda \
129
+ delete-layer-version \
130
+ --layer-name " $( ELASTIC_LAYER_NAME) -$( ARCHITECTURE) " \
131
+ --version-number 1 || echo " delete-layer-version $( ELASTIC_LAYER_NAME) -$( ARCHITECTURE) for $$ {AWS_DEFAULT_REGION} could not be found"
132
+
118
133
# Grant public access to the given LAYER in the given AWS region
119
134
grant-public-layer-access : validate-layer-name validate-aws-default-region
120
135
@echo " [debug] $( ELASTIC_LAYER_NAME) -$( ARCHITECTURE) with version: $$ ($( MAKE) -s --no-print-directory get-version)"
You can’t perform that action at this time.
0 commit comments