1
+ { {- $e2e_region := " us-west-2" -} }
2
+
1
3
stages:
2
4
- build
3
5
- test
@@ -133,21 +135,24 @@ sign-layer ({{ $runtime.name }}-{{ $runtime.arch }}):
133
135
- LAYER_FILE=datadog_lambda_py-{ { $runtime .arch} }-{ { $runtime .python_version } }.zip ./scripts/sign_layers.sh prod
134
136
135
137
{ { range $environment_name , $environment := (ds " environments" ).environments } }
138
+ { { $dotenv := print $runtime .name " _" $runtime .arch " _" $environment_name " .env" } }
136
139
137
140
publish-layer-{ { $environment_name } } ({ { $runtime .name } }-{ { $runtime .arch } }):
138
141
stage: publish
139
142
tags: ["arch:amd64"]
140
143
image: registry.ddbuild.io/images/docker:20.10-py3
141
144
rules:
142
- - if: '"{ { $environment_name } }" == "sandbox" && $REGION == "us-west-2 " && "{ { $runtime .arch } }" == "amd64"'
145
+ - if: '"{ { $environment_name } }" == "sandbox" && $REGION == "{ { $ e2e_region } } " && "{ { $runtime .arch } }" == "amd64"'
143
146
when: always
144
147
- if: '"{ { $environment_name } }" == "sandbox"'
145
148
when: manual
146
149
allow_failure: true
147
150
- if: '$CI_COMMIT_TAG =~ /^v.*/'
148
151
artifacts:
152
+ paths:
153
+ - { { $dotenv } }
149
154
reports:
150
- dotenv: layer_version
155
+ dotenv: { { $ dotenv } }
151
156
needs:
152
157
{ { if or (eq $environment_name " prod" ) } }
153
158
- sign-layer ({ { $runtime .name } }-{ { $runtime .arch} })
@@ -174,7 +179,7 @@ publish-layer-{{ $environment_name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
174
179
script:
175
180
- STAGE={ { $environment_name } } PYTHON_VERSION={ { $runtime .python_version } } ARCH={ { $runtime .arch } } ./ci/publish_layers.sh | tee publish.log
176
181
# Extract the arn from the publish log to be used as envvar in e2e tests
177
- - echo "PYTHON_{ { $runtime .python_version | strings.ReplaceAll " ." " " } }_VERSION=$(grep -oP 'Published arn \K\.*' publish.log)" > layer_version
182
+ - echo "PYTHON_{ { $runtime .python_version | strings.ReplaceAll " ." " " } }_VERSION=$(grep -oP 'Published arn \K\.*' publish.log)" > { { $ dotenv } }
178
183
179
184
{ {- end } }
180
185
@@ -256,6 +261,6 @@ e2e-test:
256
261
PYTHON_313_VERSION: latest
257
262
needs: { { range (ds " runtimes" ).runtimes } }
258
263
{ {- if eq .arch " amd64" } }
259
- - "publish-layer-sandbox ({ { .name } }-{ { .arch } }): [us-west-2 ]"
264
+ - "publish-layer-sandbox ({ { .name } }-{ { .arch } }): [{ { $ e2e_region } } ]"
260
265
{ {- end } }
261
266
{ {- end } }
0 commit comments