@@ -103,9 +103,6 @@ integration-test ({{ $runtime.name }}-{{ $runtime.arch }}):
103
103
script:
104
104
- RUNTIME_PARAM={ { $runtime .python_version } } ARCH={ { $runtime .arch } } ./scripts/run_integration_tests.sh
105
105
106
- { { range $environment := (ds " environments" ).environments } }
107
-
108
- { { if or (eq $environment .name " prod" ) } }
109
106
sign-layer ({ { $runtime .name } }-{ { $runtime .arch } }):
110
107
stage: sign
111
108
tags: ["arch:amd64"]
@@ -128,22 +125,25 @@ sign-layer ({{ $runtime.name }}-{{ $runtime.arch }}):
128
125
before_script:
129
126
- apt-get update
130
127
- apt-get install -y uuid-runtime
128
+ { { with $environment := (ds " environments" ).environments.prod } }
131
129
- EXTERNAL_ID_NAME={ { $environment .external_id } } ROLE_TO_ASSUME={ { $environment .role_to_assume } } AWS_ACCOUNT={ { $environment .account } } source ./ci/get_secrets.sh
130
+ { { end } }
132
131
script:
133
- - LAYER_FILE=datadog_lambda_py-{ { $runtime .arch} }-{ { $runtime .python_version } }.zip ./scripts/sign_layers.sh { { $environment .name } }
134
- { { end } }
132
+ - LAYER_FILE=datadog_lambda_py-{ { $runtime .arch} }-{ { $runtime .python_version } }.zip ./scripts/sign_layers.sh prod
133
+
134
+ { { range $environment_name , $environment := (ds " environments" ).environments } }
135
135
136
- publish-layer-{ { $environment .name } } ({ { $runtime .name } }-{ { $runtime .arch } }):
136
+ publish-layer-{ { $environment_name } } ({ { $runtime .name } }-{ { $runtime .arch } }):
137
137
stage: publish
138
138
tags: ["arch:amd64"]
139
139
image: registry.ddbuild.io/images/docker:20.10-py3
140
140
rules:
141
- - if: '"{ { $environment .name } }" =~ /^( sandbox|staging)/ '
141
+ - if: '"{ { $environment_name } }" == " sandbox" '
142
142
when: manual
143
143
allow_failure: true
144
144
- if: '$CI_COMMIT_TAG =~ /^v.*/'
145
145
needs:
146
- { { if or (eq $environment .name " prod" ) } }
146
+ { { if or (eq $environment_name " prod" ) } }
147
147
- sign-layer ({ { $runtime .name } }-{ { $runtime .arch} })
148
148
{ { else } }
149
149
- build-layer ({ { $runtime .name } }-{ { $runtime .arch } })
@@ -153,7 +153,7 @@ publish-layer-{{ $environment.name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
153
153
- integration-test ({ { $runtime .name } }-{ { $runtime .arch } })
154
154
{ { end } }
155
155
dependencies:
156
- { { if or (eq $environment .name " prod" ) } }
156
+ { { if or (eq $environment_name " prod" ) } }
157
157
- sign-layer ({ { $runtime .name } }-{ { $runtime .arch} })
158
158
{ { else } }
159
159
- build-layer ({ { $runtime .name } }-{ { $runtime .arch } })
@@ -166,7 +166,7 @@ publish-layer-{{ $environment.name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
166
166
before_script:
167
167
- EXTERNAL_ID_NAME={ { $environment .external_id } } ROLE_TO_ASSUME={ { $environment .role_to_assume } } AWS_ACCOUNT={ { $environment .account } } source ./ci/get_secrets.sh
168
168
script:
169
- - STAGE={ { $environment .name } } PYTHON_VERSION={ { $runtime .python_version } } ARCH={ { $runtime .arch } } ./ci/publish_layers.sh
169
+ - STAGE={ { $environment_name } } PYTHON_VERSION={ { $runtime .python_version } } ARCH={ { $runtime .arch } } ./ci/publish_layers.sh
170
170
171
171
{ {- end } }
172
172
@@ -186,3 +186,49 @@ publish-pypi-package:
186
186
{ {- end } }
187
187
script:
188
188
- ./ci/publish_pypi.sh
189
+
190
+ layer bundle:
191
+ stage: build
192
+ tags: ["arch:amd64"]
193
+ image: registry.ddbuild.io/images/docker:20.10
194
+ needs:
195
+ { { range (ds " runtimes" ).runtimes } }
196
+ - build-layer ({ { .name } }-{ { .arch } })
197
+ { { end } }
198
+ dependencies:
199
+ { { range (ds " runtimes" ).runtimes } }
200
+ - build-layer ({ { .name } }-{ { .arch } })
201
+ { { end } }
202
+ artifacts:
203
+ expire_in: 1 hr
204
+ paths:
205
+ - datadog_lambda_py-bundle-${ CI_JOB_ID} /
206
+ name: datadog_lambda_py-bundle-${ CI_JOB_ID}
207
+ script:
208
+ - rm -rf datadog_lambda_py-bundle-${ CI_JOB_ID}
209
+ - mkdir -p datadog_lambda_py-bundle-${ CI_JOB_ID}
210
+ - cp .layers/datadog_lambda_py-*.zip datadog_lambda_py-bundle-${ CI_JOB_ID}
211
+
212
+ signed layer bundle:
213
+ stage: sign
214
+ image: registry.ddbuild.io/images/docker:20.10-py3
215
+ tags: ["arch:amd64"]
216
+ rules:
217
+ - if: '$CI_COMMIT_TAG =~ /^v.*/'
218
+ needs:
219
+ { { range (ds " runtimes" ).runtimes } }
220
+ - sign-layer ({ { .name } }-{ { .arch } })
221
+ { { end } }
222
+ dependencies:
223
+ { { range (ds " runtimes" ).runtimes } }
224
+ - sign-layer ({ { .name } }-{ { .arch } })
225
+ { { end } }
226
+ artifacts:
227
+ expire_in: 1 day
228
+ paths:
229
+ - datadog_lambda_py-signed-bundle-${ CI_JOB_ID} /
230
+ name: datadog_lambda_py-signed-bundle-${ CI_JOB_ID}
231
+ script:
232
+ - rm -rf datadog_lambda_py-signed-bundle-${ CI_JOB_ID}
233
+ - mkdir -p datadog_lambda_py-signed-bundle-${ CI_JOB_ID}
234
+ - cp .layers/datadog_lambda_py-*.zip datadog_lambda_py-signed-bundle-${ CI_JOB_ID}
0 commit comments