diff --git a/ci-test-manifest-integration.yml b/ci-test-manifest-integration.yml deleted file mode 100644 index f6081fff490e008962dd29b1ec7f3bde2fb1038f..0000000000000000000000000000000000000000 --- a/ci-test-manifest-integration.yml +++ /dev/null @@ -1,179 +0,0 @@ ---- -# --------------------------------------------------------------------------------------- -# Global -# --------------------------------------------------------------------------------------- -include: - - local: common.yml - -stages: - - infrastructure - - integrate - - merge - - build - - check - -variables: - # FIXME: due to a missing feature in GitLab, we cannot use this variable in the build - # stage further down this file. If it ever changes, it has to be changed there too. - # (https://gitlab.com/gitlab-org/gitlab/-/issues/249583) - MANIFEST_PROJECT: "${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/\ - ci-test/minimal-manifest" - MANIFEST_FILE: "default.xml" - # The master branch is hardcoded here, because it cannot be determined automatically. - # Has to be modified for new branches, e.g. new Yocto versions or fix releases. - MASTER_BRANCH_MANIFEST: master - MASTER_BRANCH_PROJECT: master - - # The BB_RECIPE_NAME is used for projects referenced in the SRCREV file - # to match the repository and the bitbake recipe name. - # We set it here to none, as every project needing it - # has to specify it in its own gitlab-ci.yml file. - # The BB_RECIPE_NAME is passed to the python scripts below anyway, but not - # used for projects referenced in the manifest file. - BB_RECIPE_NAME: none - -workflow: - rules: - # Explicitly allow externally triggered pipelines in every case - - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" - # Do not run pipelines on forked projects. - # The pipelines would not work anyway because of the users permissions. - # There are two cases catched here: - # 1. The project is forked into someones gitlab namespace and a MR to - # include a change into this forked project is created. In this case - # is the CI_PROJECT_ROOT_NAMESPACE not seco-ne but the - # namespace the fork lives in. - # 2. The MR from the forked project is created to merge the change into this - # the project in the seco-ne namespace (customer sending - # change to us). Here the the IDs used below differ. - # - - if: $CI_PROJECT_ROOT_NAMESPACE == "seco-ne" - && $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID - -# --------------------------------------------------------------------------------------- -# integrate -# Create a commit in the manifest to pull this change -# --------------------------------------------------------------------------------------- -integrate: - extends: .infrastructure - rules: - # Do not integration pipeline for merge requests for integrate/gitlab-ci/ branches - # The integration is done from the pipeline in gitlab-ci already - - if: $CI_COMMIT_REF_NAME =~ /^integrate\/gitlab-ci\/.*/ - when: never - # We have to make sure that the pipeline runs for the current manifest - # master at the time a merge request is created. Otherwise we cannot - # guarantee a green master after merging. - - if: $CI_MERGE_REQUEST_IID - # Explicitly allow externally triggered pipelines in every case - - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" - cache: - policy: push - script: - - cd ${CI_PROJECT_DIR} - - if [ -n "${CI_MERGE_REQUEST_IID}" ];then - MERGE_REQUEST="${CI_MERGE_REQUEST_IID}"; - else - MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}"; - fi - - .gitlab-ci/scripts/integrate_into_manifest.py - --gitlab-url=${CI_SERVER_URL} - --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} - --manifest-file=${MANIFEST_FILE} - --integration-base=${MASTER_BRANCH_MANIFEST} - --project=${CI_PROJECT_PATH} - --merge-request=${MERGE_REQUEST} - --save-revision-to=manifest_revision - --recipe-name=${BB_RECIPE_NAME} - artifacts: - paths: - - manifest_revision - -# -------------------------------------------------------------------------------------- -# Stage: merge -# -------------------------------------------------------------------------------------- -merge: - extends: .infrastructure - stage: merge - rules: - - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT - script: - - cd ${CI_PROJECT_DIR} - - .gitlab-ci/scripts/merge_into_manifest.py - --gitlab-url=${CI_SERVER_URL} - --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} - --master-branch=${MASTER_BRANCH_MANIFEST} - --project=${CI_PROJECT_PATH} - --master-branch-project=${MASTER_BRANCH_PROJECT} - --commit=${CI_COMMIT_SHA} - --save-revision-to=manifest_revision - --recipe-name=${BB_RECIPE_NAME} - artifacts: - paths: - - manifest_revision - -# -------------------------------------------------------------------------------------- -# Stage: build -# -------------------------------------------------------------------------------------- -build: - stage: build - rules: - # Do not run build if the "skip build" label is set on the merge request - - if: $CI_MERGE_REQUEST_LABELS =~ /skip build/ - when: never - # execute this in MR only and not for integrate/gitlab-ci/ integrations - # branches. These are build after the integration has been done in all - # projects - - if: $CI_MERGE_REQUEST_IID && $CI_COMMIT_REF_NAME !~ /^integrate\/gitlab-ci\/.*/ - trigger: - project: seco-ne/yocto/infrastructure/ci-test/minimal-manifest - branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}" - strategy: depend - -# -------------------------------------------------------------------------------------- -# Stage: check -# -------------------------------------------------------------------------------------- -check: - extends: .infrastructure - stage: check - rules: - # Do not run check if the "skip build" label is set on the merge request - - if: $CI_MERGE_REQUEST_LABELS =~ /skip build/ - when: never - # Do not integration pipeline for merge requests for integrate/gitlab-ci/ branches - # The integration is done from the pipeline in gitlab-ci already - - if: $CI_COMMIT_REF_NAME =~ /^integrate\/gitlab-ci\/.*/ - when: never - - if: $CI_MERGE_REQUEST_IID - # Explicitly allow externally triggered pipelines in every case - - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" - needs: ["integrate"] - allow_failure: true - script: - - cd ${CI_PROJECT_DIR} - # When running in a trigger pipeline the CII_MERGE_REQUEST_IID is not set - # but CI_OPEN_MERGE_REQUESTS. We use the first of this comma separated list - # in this case - - if [ -n "${CI_MERGE_REQUEST_IID}" ];then - MERGE_REQUEST="${CI_MERGE_REQUEST_IID}"; - else - MERGE_REQUEST="${CI_OPEN_MERGE_REQUESTS%%,*}"; - fi - # The 'parent_merge_request' is passed from the trigger - # in case this check job is part of a gitlab-ci integration - # pipeline. It is only used to display the correct MR to run again - # in a failed check - - if [ -n "${parent_merge_request}" ];then - PARENT_MR="--parent-merge-request=${parent_merge_request}"; - fi - - .gitlab-ci/scripts/check_if_integration_branch_is_up_to_date.py - --gitlab-url=${CI_SERVER_URL} - --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} - --integration-base=${MASTER_BRANCH_MANIFEST} - --project=${CI_PROJECT_PATH} - --merge-request=${MERGE_REQUEST} - --verbose - ${PARENT_MR} diff --git a/manifest-integration-ci-test.yml b/manifest-integration-ci-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..63e0764f6dc4ce84ec76e60de59675ef5389738a --- /dev/null +++ b/manifest-integration-ci-test.yml @@ -0,0 +1,15 @@ +--- +include: + - local: manifest-integration.yml + +variables: + # FIXME: This variable is used in the manifest-integration's build stage for the + # trigger project. Due to a missing feature in GitLab, we cannot use any variables + # here and have to hard-code 'seco-ne' instead of using CI_PROJECT_ROOT_NAMESPACE. + # (https://gitlab.com/gitlab-org/gitlab/-/issues/249583) + MANIFEST_PROJECT: seco-ne/yocto/infrastructure/ci-test/minimal-manifest + + # The master branch is hardcoded here, because it cannot be determined automatically. + # Has to be modified for new branches, e.g. new Yocto versions or fix releases. + MASTER_BRANCH_MANIFEST: master + MASTER_BRANCH_PROJECT: master diff --git a/manifest-integration-yocto.yml b/manifest-integration-yocto.yml new file mode 100644 index 0000000000000000000000000000000000000000..e094eb75624d6bc02f9f4898d3c00253f70b7aa9 --- /dev/null +++ b/manifest-integration-yocto.yml @@ -0,0 +1,15 @@ +--- +include: + - local: manifest-integration.yml + +variables: + # FIXME: This variable is used in the manifest-integration's build stage for the + # trigger project. Due to a missing feature in GitLab, we cannot use any variables + # here and have to hard-code 'seco-ne' instead of using CI_PROJECT_ROOT_NAMESPACE. + # (https://gitlab.com/gitlab-org/gitlab/-/issues/249583) + MANIFEST_PROJECT: seco-ne/yocto/manifest + + # The master branch is hardcoded here, because it cannot be determined automatically. + # Has to be modified for new branches, e.g. new Yocto versions or fix releases. + MASTER_BRANCH_MANIFEST: dunfell + MASTER_BRANCH_PROJECT: dunfell diff --git a/manifest-integration.yml b/manifest-integration.yml index 8349ded5bbeefafcef687613992bd2ff34ebb266..bedee125668b78db4dce0ba34fbd12ab06a05eb2 100644 --- a/manifest-integration.yml +++ b/manifest-integration.yml @@ -13,16 +13,7 @@ stages: - check variables: - # FIXME: due to a missing feature in GitLab, we cannot use this variable in the build - # stage further down this file. If it ever changes, it has to be changed there too. - # (https://gitlab.com/gitlab-org/gitlab/-/issues/249583) - MANIFEST_PROJECT: "${CI_PROJECT_ROOT_NAMESPACE}/yocto/manifest" MANIFEST_FILE: "default.xml" - # The master branch is hardcoded here, because it cannot be determined automatically. - # Has to be modified for new branches, e.g. new Yocto versions or fix releases. - MASTER_BRANCH_MANIFEST: dunfell - MASTER_BRANCH_PROJECT: dunfell - # The BB_RECIPE_NAME is used for projects referenced in the SRCREV file # to match the repository and the bitbake recipe name. # We set it here to none, as every project needing it @@ -127,7 +118,7 @@ build: # projects - if: $CI_MERGE_REQUEST_IID && $CI_COMMIT_REF_NAME !~ /^integrate\/gitlab-ci\/.*/ trigger: - project: seco-ne/yocto/manifest + project: !reference [variables, MANIFEST_PROJECT] branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}" strategy: depend