diff --git a/.gitlab/input_files/build.yaml.tpl b/.gitlab/input_files/build.yaml.tpl index 737d746e..972da4e8 100644 --- a/.gitlab/input_files/build.yaml.tpl +++ b/.gitlab/input_files/build.yaml.tpl @@ -1,3 +1,5 @@ +{{- $e2e_region := "us-west-2" -}} + variables: CI_DOCKER_TARGET_IMAGE: registry.ddbuild.io/ci/datadog-lambda-js CI_DOCKER_TARGET_VERSION: latest @@ -7,6 +9,7 @@ stages: - test - sign - publish + - e2e default: retry: @@ -126,6 +129,8 @@ publish layer {{ $environment.name }} ({{ $runtime.name }}): tags: ["arch:amd64"] image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION} rules: + - if: '"{{ $environment.name }}" == "sandbox" && $REGION == "{{ $e2e_region }}"' + when: on_success - if: '"{{ $environment.name }}" =~ /^(sandbox|staging)/' when: manual allow_failure: true @@ -203,3 +208,18 @@ publish npm package: - mkdir -p datadog_lambda_js-{{ if eq $environment.name "prod"}}signed-{{ end }}bundle-${CI_JOB_ID} - cp .layers/datadog_lambda_node*.zip datadog_lambda_js-{{ if eq $environment.name "prod"}}signed-{{ end }}bundle-${CI_JOB_ID} {{ end }} + +e2e-test: + stage: e2e + trigger: + project: DataDog/serverless-e2e-tests + strategy: depend + variables: + LANGUAGES_SUBSET: node + # These env vars are inherited from the dotenv reports of the publish-layer jobs + {{- range (ds "runtimes").runtimes }} + NODEJS_{{ .node_version }}_VERSION: $NODEJS_{{ .node_version }}_VERSION + {{- end }} + needs: {{ range (ds "runtimes").runtimes }} + - "publish layer sandbox ({{ .name }}): [{{ $e2e_region }}]" + {{- end }}