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

Check if variable is defined before checking it value

parent c1be0f4b
No related branches found
No related tags found
1 merge request!199Check if variable is defined before checking it value
Pipeline #28684 waiting for manual action with stages
in 1 minute and 53 seconds
...@@ -35,8 +35,9 @@ generate: ...@@ -35,8 +35,9 @@ 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 or {% if (CI_MERGE_REQUEST_TARGET_BRANCH_NAME is defined
SOURCE_BRANCH == CI_COMMIT_REF_NAME %} and SOURCE_BRANCH == CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
or 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
...@@ -53,8 +54,9 @@ generate: ...@@ -53,8 +54,9 @@ 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 or {% if (CI_MERGE_REQUEST_TARGET_BRANCH_NAME is defined
SOURCE_BRANCH == CI_COMMIT_REF_NAME %} and SOURCE_BRANCH == CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
or SOURCE_BRANCH == CI_COMMIT_REF_NAME %}
{{ TARGET_PROJECT }}:{{ TARGET_BRANCH }}: {{ TARGET_PROJECT }}:{{ TARGET_BRANCH }}:
stage: infrastructure stage: infrastructure
......
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