1+ {{- $e2e_region := " us-west-2" -}}
2+
13variables:
24 CI_DOCKER_TARGET_IMAGE: registry.ddbuild.io /ci/datadog-lambda-js
35 CI_DOCKER_TARGET_VERSION: latest
79 - test
810 - sign
911 - publish
12+ - e2e
1013
1114default:
1215 retry:
@@ -94,6 +97,7 @@ integration test ({{ $runtime.name }}):
9497 - RUNTIME_PARAM= {{ $runtime .node_major_version }} . /scripts/run_integration_tests.sh
9598
9699{{ range $environment := (ds " environments" ).environments }}
100+ {{ $dotenv := print $runtime .name " _" $environment .name " .env" }}
97101
98102{{ if or (eq $environment .name " prod" ) }}
99103sign layer ({{ $runtime .name }}):
@@ -126,10 +130,15 @@ publish layer {{ $environment.name }} ({{ $runtime.name }}):
126130 tags: [" arch:amd64" ]
127131 image: $ {CI_DOCKER_TARGET_IMAGE}:$ {CI_DOCKER_TARGET_VERSION}
128132 rules:
133+ - if : '" {{ $environment.name }}" == " sandbox" && $REGION == " {{ $e2e_region }}" '
134+ when: on_success
129135 - if : '" {{ $environment.name }}" = ~ /^(sandbox| staging)/'
130136 when: manual
131137 allow_failure: true
132138 - if : '$CI_COMMIT_TAG = ~ /^v. */'
139+ artifacts:
140+ reports:
141+ dotenv: {{ $dotenv }}
133142 needs:
134143{{ if or (eq $environment .name " prod" ) }}
135144 - sign layer ({{ $runtime .name }})
@@ -154,7 +163,7 @@ publish layer {{ $environment.name }} ({{ $runtime.name }}):
154163 before_script:
155164 - EXTERNAL_ID_NAME= {{ $environment .external_id }} ROLE_TO_ASSUME= {{ $environment .role_to_assume }} AWS_ACCOUNT= {{ $environment .account }} source .gitlab /scripts/get_secrets.sh
156165 script:
157- - STAGE= {{ $environment .name }} NODE_VERSION= {{ $runtime .node_version }} .gitlab /scripts/publish_layers.sh
166+ - STAGE= {{ $environment .name }} NODE_VERSION= {{ $runtime .node_version }} DOTENV = {{ $dotenv }} .gitlab /scripts/publish_layers.sh
158167
159168{{- end }}
160169
@@ -203,3 +212,27 @@ publish npm package:
203212 - mkdir -p datadog_lambda_js-{{ if eq $environment .name " prod" }}signed-{{ end }}bundle-$ {CI_JOB_ID}
204213 - cp .layers /datadog_lambda_node*.zip datadog_lambda_js-{{ if eq $environment .name " prod" }}signed-{{ end }}bundle-$ {CI_JOB_ID}
205214{{ end }}
215+
216+ e2e-test:
217+ stage: e2e
218+ trigger:
219+ project: DataDog/serverless-e2e-tests
220+ strategy: depend
221+ variables:
222+ LANGUAGES_SUBSET: node
223+ {{- range (ds " runtimes" ).runtimes }}
224+ {{- $version := print (.name | strings.Trim " node" ) }}
225+ NODEJS_{{ $version }}_VERSION: $NODE_ {{ $version }}_VERSION
226+ {{- end }}
227+ needs: {{ range (ds " runtimes" ).runtimes }}
228+ - " publish layer sandbox ({{ .name }}): [{{ $e2e_region }}]"
229+ {{- end }}
230+
231+
232+ e2e-test-status:
233+ stage: e2e
234+ image: registry.ddbuild.io /images/docker:20.10 -py3
235+ tags: [" arch:amd64" ]
236+ timeout: 3h
237+ script:
238+ - .gitlab /scripts/poll_e2e.sh
0 commit comments