Skip to content

Commit 1e5bd20

Browse files
Running Gitlab jobs based on upstream pipeline existence
1 parent e1a0bac commit 1e5bd20

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ build-layers:
2525
- artifact: ci/build-pipeline.yaml
2626
job: generator
2727
strategy: depend
28+
forward:
29+
pipeline_variables: true
2830
rules:
29-
- when: on_success
31+
- when: on_success

ci/input_files/build.yaml.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ sign-layer ({{ $runtime.name }}-{{ $runtime.arch }}):
111111
tags: ["arch:amd64"]
112112
image: registry.ddbuild.io/images/docker:20.10-py3
113113
rules:
114+
- if: $UPSTREAM_COMMIT_BRANCH
115+
when: never
114116
- if: '$CI_COMMIT_TAG =~ /^v.*/'
115117
when: manual
116118
needs:
@@ -142,6 +144,8 @@ publish-layer-{{ $environment_name }} ({{ $runtime.name }}-{{ $runtime.arch }}):
142144
tags: ["arch:amd64"]
143145
image: registry.ddbuild.io/images/docker:20.10-py3
144146
rules:
147+
- if: $UPSTREAM_COMMIT_BRANCH
148+
when: never
145149
- if: '"{{ $environment_name }}" == "sandbox" && $REGION == "{{ $e2e_region }}" && "{{ $runtime.arch }}" == "amd64"'
146150
when: on_success
147151
- if: '"{{ $environment_name }}" == "sandbox"'
@@ -188,6 +192,8 @@ publish-pypi-package:
188192
before_script: *python-before-script
189193
cache: []
190194
rules:
195+
- if: $UPSTREAM_COMMIT_BRANCH
196+
when: never
191197
- if: '$CI_COMMIT_TAG =~ /^v.*/'
192198
when: manual
193199
needs: {{ range $runtime := (ds "runtimes").runtimes }}
@@ -200,6 +206,9 @@ layer bundle:
200206
stage: build
201207
tags: ["arch:amd64"]
202208
image: registry.ddbuild.io/images/docker:20.10
209+
rules:
210+
- if: $UPSTREAM_COMMIT_BRANCH
211+
when: never
203212
needs:
204213
{{ range (ds "runtimes").runtimes }}
205214
- build-layer ({{ .name }}-{{ .arch }})
@@ -223,6 +232,8 @@ signed layer bundle:
223232
image: registry.ddbuild.io/images/docker:20.10-py3
224233
tags: ["arch:amd64"]
225234
rules:
235+
- if: $UPSTREAM_COMMIT_BRANCH
236+
when: never
226237
- if: '$CI_COMMIT_TAG =~ /^v.*/'
227238
needs:
228239
{{ range (ds "runtimes").runtimes }}
@@ -247,6 +258,9 @@ e2e-test:
247258
trigger:
248259
project: DataDog/serverless-e2e-tests
249260
strategy: depend
261+
rules:
262+
- if: $UPSTREAM_COMMIT_BRANCH
263+
when: never
250264
variables:
251265
LANGUAGES_SUBSET: python
252266
# These env vars are inherited from the dotenv reports of the publish-layer jobs
@@ -265,6 +279,9 @@ e2e-test:
265279
e2e-test-status:
266280
stage: e2e
267281
image: registry.ddbuild.io/images/docker:20.10-py3
282+
rules:
283+
- if: $UPSTREAM_COMMIT_BRANCH
284+
when: never
268285
tags: ["arch:amd64"]
269286
timeout: 3h
270287
script: |

0 commit comments

Comments
 (0)