Skip to content

Commit 73650f9

Browse files
Running Gitlab jobs based on skip_e2e_tests variable (#700)
* Running Gitlab jobs based on upstream pipeline existence * check value of env var * more prints * removing gate on e2e tests * another print * print * using upstream project name variable * colons * when on success * Replace commit branch with project name * force fail * remove force fail * Use skip e2e tests global variable * check skip_e2e_test=true explicitly * make variable a string
1 parent f2a704c commit 73650f9

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
variables:
2+
SKIP_E2E_TESTS: "false"
3+
14
stages:
25
- pre
36
- build
@@ -25,5 +28,7 @@ build-layers:
2528
- artifact: ci/build-pipeline.yaml
2629
job: generator
2730
strategy: depend
31+
forward:
32+
pipeline_variables: true
2833
rules:
29-
- when: on_success
34+
- when: on_success

ci/input_files/build.yaml.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ publish-layer-{{ $environment_name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
142142
tags: ["arch:amd64"]
143143
image: registry.ddbuild.io/images/docker:20.10-py3
144144
rules:
145+
- if: '$SKIP_E2E_TESTS == "true"'
146+
when: never
145147
- if: '"{{ $environment_name }}" == "sandbox" && $REGION == "{{ $e2e_region }}" && "{{ $runtime.arch }}" == "amd64"'
146148
when: on_success
147149
- if: '"{{ $environment_name }}" == "sandbox"'
@@ -247,6 +249,10 @@ e2e-test:
247249
trigger:
248250
project: DataDog/serverless-e2e-tests
249251
strategy: depend
252+
rules:
253+
- if: '$SKIP_E2E_TESTS == "true"'
254+
when: never
255+
- when: on_success
250256
variables:
251257
LANGUAGES_SUBSET: python
252258
# These env vars are inherited from the dotenv reports of the publish-layer jobs
@@ -267,6 +273,10 @@ e2e-test-status:
267273
image: registry.ddbuild.io/images/docker:20.10-py3
268274
tags: ["arch:amd64"]
269275
timeout: 3h
276+
rules:
277+
- if: '$SKIP_E2E_TESTS == "true"'
278+
when: never
279+
- when: on_success
270280
script: |
271281
GITLAB_API_TOKEN=$(aws ssm get-parameter --region us-east-1 --name "ci.${CI_PROJECT_NAME}.serverless-e2e-gitlab-token" --with-decryption --query "Parameter.Value" --out text)
272282
URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/bridges"

0 commit comments

Comments
 (0)