diff --git a/manifest-integration-jobs.yml.jinja2 b/manifest-integration-jobs.yml similarity index 85% rename from manifest-integration-jobs.yml.jinja2 rename to manifest-integration-jobs.yml index 1553845db31c3a85a3f73370dbbe0061ae16c13c..fe049d0d465ffbebfc5eee0316c291773dc696a5 100644 --- a/manifest-integration-jobs.yml.jinja2 +++ b/manifest-integration-jobs.yml @@ -3,11 +3,8 @@ # Global # -------------------------------------------------------------------------------------- include: - # FIXME: see FIXME comments in manifest-integration-pipelines.yml.jinja2 - # - project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci' - # ref: ${GITLAB_CI_REVISION} - - project: {{ CI_PROJECT_ROOT_NAMESPACE }}/yocto/infrastructure/gitlab-ci - ref: {{ GITLAB_CI_REVISION }} + - project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci' + ref: ${GITLAB_CI_REVISION} file: common.yml workflow: @@ -57,9 +54,7 @@ build: when: never - if: $CI_MERGE_REQUEST_IID trigger: - # FIXME: see FIXME comments in manifest-integration-pipelines.yml.jinja2 - # project: $TARGET_PROJECT - project: {{ TARGET_PROJECT }} + project: $TARGET_PROJECT branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/into/${TARGET_BRANCH}" strategy: depend diff --git a/manifest-integration-pipelines.yml.jinja2 b/manifest-integration-pipelines.yml.jinja2 index 6eb9ee6672ea6042075516b1ca3b6f47d227a2cc..cf637459e0bdcbbc9e2fcf433e44cda2209bd296 100644 --- a/manifest-integration-pipelines.yml.jinja2 +++ b/manifest-integration-pipelines.yml.jinja2 @@ -14,42 +14,6 @@ workflow: stages: - manifest-integration-pipelines -# -------------------------------------------------------------------------------------- -# Generate job -# -------------------------------------------------------------------------------------- -# Use one single job to generate multiple yaml files for the downstream pipelines. -# FIXME: This is only necessary due to a GitLab limitation: -# https://gitlab.com/gitlab-org/gitlab/-/issues/347469 -# We work around this by generating manifest-integration-jobs.yml from a Jinja2 template -# and insert the trigger project via a Jinja2 variable. -# The issue is already fixed and will be released in GitLab 15.3: -# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92346 -# As soon as we update to this version, we can get rid of the generate job and convert -# the Jinja2 template to a simple YAML file. -generate: - extends: - - .infrastructure - stage: manifest-integration-pipelines - script: - # The job generation script implicitly passes the OS environment to the template, so - # that the template has access to all GitLab CI variables. Hence there is no need - # to explicitly pass any of them as command line arguments. -{% for integration in INTEGRATION.split('\n') %} -{% set SOURCE_BRANCH, TARGET_PROJECT, TARGET_BRANCH = integration.split(':') %} -{% if (CI_MERGE_REQUEST_TARGET_BRANCH_NAME is defined - and SOURCE_BRANCH == CI_MERGE_REQUEST_TARGET_BRANCH_NAME) - or SOURCE_BRANCH == CI_COMMIT_REF_NAME %} - - TARGET_PROJECT={{ TARGET_PROJECT }} - .gitlab-ci/scripts/generate_job_from_template.py - --template=.gitlab-ci/manifest-integration-jobs.yml.jinja2 - > manifest-integration-jobs-{{ loop.index }}.yml -{% endif %} -{% endfor %} - artifacts: - expire_in: 4 weeks - paths: - - manifest-integration-jobs-*.yml - # -------------------------------------------------------------------------------------- # Trigger jobs # -------------------------------------------------------------------------------------- @@ -61,8 +25,6 @@ generate: {{ TARGET_PROJECT }}:{{ TARGET_BRANCH }}: stage: manifest-integration-pipelines - needs: - - generate variables: SOURCE_BRANCH: {{ SOURCE_BRANCH }} TARGET_PROJECT: {{ TARGET_PROJECT }} @@ -72,12 +34,9 @@ generate: BB_RECIPE_NAME: {{ BB_RECIPE_NAME }} trigger: include: - # FIXME: Use these settings after switching from jinja2 to yaml (see above) - # project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci' - # ref: ${GITLAB_CI_REVISION} - # file: manifest-integration-jobs.yml - artifact: manifest-integration-jobs-{{ loop.index }}.yml - job: generate + project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci' + ref: ${GITLAB_CI_REVISION} + file: manifest-integration-jobs.yml strategy: depend {% endif %}