Skip to content
Snippets Groups Projects
Commit 8da534ec authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Run integration pipeline for target branch only

When we're integrating a single branch into a single manifest branch,
there is no need to run the intgeration pipeline for all configured
integrations, but only for those that match the target branch of the
current merge request.
parent 8c94b725
No related branches found
No related tags found
1 merge request!197Run integration pipeline for target branch only
Pipeline #28644 waiting for manual action with stages
in 1 minute and 38 seconds
...@@ -35,10 +35,13 @@ generate: ...@@ -35,10 +35,13 @@ generate:
# to explicitly pass any of them as command line arguments. # to explicitly pass any of them as command line arguments.
{% for integration in INTEGRATION.split('\n') %} {% for integration in INTEGRATION.split('\n') %}
{% set SOURCE_BRANCH, TARGET_PROJECT, TARGET_BRANCH = integration.split(':') %} {% set SOURCE_BRANCH, TARGET_PROJECT, TARGET_BRANCH = integration.split(':') %}
{% if SOURCE_BRANCH == CI_MERGE_REQUEST_TARGET_BRANCH_NAME ||
SOURCE_BRANCH == CI_COMMIT_REF_NAME %}
- TARGET_PROJECT={{ TARGET_PROJECT }} - TARGET_PROJECT={{ TARGET_PROJECT }}
.gitlab-ci/scripts/generate_job_from_template.py .gitlab-ci/scripts/generate_job_from_template.py
--template=.gitlab-ci/manifest-integration-jobs.yml.jinja2 --template=.gitlab-ci/manifest-integration-jobs.yml.jinja2
> manifest-integration-jobs-{{ loop.index }}.yml > manifest-integration-jobs-{{ loop.index }}.yml
{% endif %}
{% endfor %} {% endfor %}
artifacts: artifacts:
expire_in: 4 weeks expire_in: 4 weeks
...@@ -50,6 +53,8 @@ generate: ...@@ -50,6 +53,8 @@ generate:
# -------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------
{% for integration in INTEGRATION.split('\n') %} {% for integration in INTEGRATION.split('\n') %}
{% set SOURCE_BRANCH, TARGET_PROJECT, TARGET_BRANCH = integration.split(':') %} {% set SOURCE_BRANCH, TARGET_PROJECT, TARGET_BRANCH = integration.split(':') %}
{% if SOURCE_BRANCH == CI_MERGE_REQUEST_TARGET_BRANCH_NAME ||
SOURCE_BRANCH == CI_COMMIT_REF_NAME %}
{{ TARGET_PROJECT }}:{{ TARGET_BRANCH }}: {{ TARGET_PROJECT }}:{{ TARGET_BRANCH }}:
stage: infrastructure stage: infrastructure
...@@ -72,4 +77,5 @@ generate: ...@@ -72,4 +77,5 @@ generate:
job: generate job: generate
strategy: depend strategy: depend
{% endif %}
{% endfor %} {% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment