diff --git a/build-common.yml b/build-common.yml index 4737f29e39012c8260f64fdf09b039e4a56dbb6c..c3b1225e1756e4644bd734e3eb517d8903a4cd89 100644 --- a/build-common.yml +++ b/build-common.yml @@ -84,7 +84,7 @@ workflow: GITLAB_SERVER: "${CI_SERVER_HOST}:${CI_SERVER_SSH_PORT}" GIT_BASE_URL: "ssh://git@${GITLAB_SERVER}/${CI_PROJECT_ROOT_NAMESPACE}" TESTS_GIT_URL: "${GIT_BASE_URL}/yocto/tests.git" - TEST_REPO_BRANCH: ${MASTER_BRANCH_MANIFEST} + TEST_REPO_BRANCH: ${MASTER_BRANCH} artifacts: when: always paths: diff --git a/build-jobs-yocto.jinja2 b/build-jobs-yocto.jinja2 index c6e8cc340c8a16dc65dc96aca543249e4466c43d..42295ef0b5fdc3747aee9b73a88f24aa492a34b8 100644 --- a/build-jobs-yocto.jinja2 +++ b/build-jobs-yocto.jinja2 @@ -21,7 +21,7 @@ stages: - uploadftp variables: - MASTER_BRANCH_MANIFEST: {{ MASTER_BRANCH_MANIFEST }} + MASTER_BRANCH: {{ MASTER_BRANCH }} # -------------------------------------------------------------------------------------- # Stage: infrastructure @@ -30,7 +30,7 @@ changelog: extends: .infrastructure script: .gitlab-ci/scripts/changelog_generator.py --token=${GITBOT_TOKEN} - --branch=${MASTER_BRANCH_MANIFEST} + --branch=${MASTER_BRANCH} > changelog.md artifacts: expire_in: 4 weeks diff --git a/common.yml b/common.yml index 61a01f0a9eba2fb18638224d3dad754e8c7a19e8..0d3f2fef0cfaaa4062091d0259d0de19e76d31e2 100644 --- a/common.yml +++ b/common.yml @@ -36,7 +36,7 @@ variables: - if: $CI_PIPELINE_SOURCE == "parent_pipeline" when: never # Usually run this job only on non-master branches, i.e. in merge requests - - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST + - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH # Additionally run this job if pipeline was triggered by the API, which happens e.g. # when no pipeline has run in a merge request, so a full build pipeline is needed on # the master diff --git a/docs/automatic-manifest-integration.md b/docs/automatic-manifest-integration.md index 038128af712025bfc5c3e6ab70dea695eb66e35f..c018c631bea2d5c148db97a31b005e23f37c2245 100644 --- a/docs/automatic-manifest-integration.md +++ b/docs/automatic-manifest-integration.md @@ -188,7 +188,6 @@ the git revision in the `SRCREV.conf` file on project changes. 2. Add an approriate `.gitlab-ci.yml` file. For example, copy it from the repository [egalxi2c][8]. Modify the following variables in the file: - * `MASTER_BRANCH_PROJECT`: Set the project master branch * `BB_RECIPE_NAME`: Set the name of the bitbake recipe 3. Create a corresponding entry in the `SRCREV.conf` file of the manifest repo:\ diff --git a/manifest-integration-ci-test.yml b/manifest-integration-ci-test.yml deleted file mode 100644 index 63e0764f6dc4ce84ec76e60de59675ef5389738a..0000000000000000000000000000000000000000 --- a/manifest-integration-ci-test.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -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-jobs.yml.jinja2 b/manifest-integration-jobs.yml.jinja2 index 7f7253d84e767c7f7965d5380a83b0369074eaf2..19eb22d7360669efec0a04b31a0a0c9451757fdb 100644 --- a/manifest-integration-jobs.yml.jinja2 +++ b/manifest-integration-jobs.yml.jinja2 @@ -40,9 +40,9 @@ integrate: - .gitlab-ci/scripts/integrate_into_manifest.py --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} + --manifest-project=${TARGET_PROJECT} --manifest-file=${MANIFEST_FILE} - --integration-base=${MASTER_BRANCH_MANIFEST} + --integration-base=${TARGET_BRANCH} --project=${CI_PROJECT_PATH} --merge-request=${MERGE_REQUEST} --save-revision-to=manifest_revision @@ -61,16 +61,16 @@ merge: extends: .infrastructure stage: merge rules: - - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT + - if: $CI_COMMIT_BRANCH == $SOURCE_BRANCH 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} + --manifest-project=${TARGET_PROJECT} + --master-branch=${TARGET_BRANCH} --project=${CI_PROJECT_PATH} - --master-branch-project=${MASTER_BRANCH_PROJECT} + --master-branch-project=${SOURCE_BRANCH} --commit=${CI_COMMIT_SHA} --save-revision-to=manifest_revision --recipe-name=${BB_RECIPE_NAME} @@ -90,9 +90,9 @@ build: - if: $CI_MERGE_REQUEST_IID trigger: # FIXME: see FIXME comments in manifest-integration-pipelines.yml.jinja2 - # project: $MANIFEST_PROJECT + # project: $TARGET_PROJECT project: {{ TARGET_PROJECT }} - branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/into/${MASTER_BRANCH_MANIFEST}" + branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/into/${TARGET_BRANCH}" strategy: depend # -------------------------------------------------------------------------------------- @@ -128,8 +128,8 @@ check: - .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} + --manifest-project=${TARGET_PROJECT} + --integration-base=${TARGET_BRANCH} --project=${CI_PROJECT_PATH} --merge-request=${MERGE_REQUEST} --verbose diff --git a/manifest-integration-pipelines.yml.jinja2 b/manifest-integration-pipelines.yml.jinja2 index 6f8406dc28c2fd44f77415c242bf882119bde122..dab38b5514588f9afb58e2b6c51239fa8f4ef852 100644 --- a/manifest-integration-pipelines.yml.jinja2 +++ b/manifest-integration-pipelines.yml.jinja2 @@ -56,9 +56,9 @@ generate: needs: - generate variables: - MASTER_BRANCH_PROJECT: {{ SOURCE_BRANCH }} - MANIFEST_PROJECT: {{ TARGET_PROJECT }} - MASTER_BRANCH_MANIFEST: {{ TARGET_BRANCH }} + SOURCE_BRANCH: {{ SOURCE_BRANCH }} + TARGET_PROJECT: {{ TARGET_PROJECT }} + TARGET_BRANCH: {{ TARGET_BRANCH }} GITLAB_CI_REVISION: {{ GITLAB_CI_REVISION }} MANIFEST_FILE: {{ MANIFEST_FILE }} BB_RECIPE_NAME: {{ BB_RECIPE_NAME }} diff --git a/manifest-integration-yocto.yml b/manifest-integration-yocto.yml deleted file mode 100644 index e094eb75624d6bc02f9f4898d3c00253f70b7aa9..0000000000000000000000000000000000000000 --- a/manifest-integration-yocto.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -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-pipeline-ci-test.yml b/manifest-pipeline-ci-test.yml index c5b9f7d6e41bd42b75ebbad320d6de28f5877a32..9ecd5a278b3d6e88599e12f659a11adc4aa63c0a 100644 --- a/manifest-pipeline-ci-test.yml +++ b/manifest-pipeline-ci-test.yml @@ -20,5 +20,4 @@ variables: # 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 + MASTER_BRANCH: master diff --git a/manifest-pipeline.yml b/manifest-pipeline.yml index 05dcf8124b815a1433a0fcc47c17061e855c657b..778775798ffb1d51e95e414aa27fb56b0db31f74 100644 --- a/manifest-pipeline.yml +++ b/manifest-pipeline.yml @@ -33,7 +33,7 @@ workflow: rules: # Run the full build pipeline on non-master branches (i.e. in the merge request) # or if explicitly triggered by the API or the web button. - - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH_MANIFEST + - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH - if: $CI_PIPELINE_SOURCE == "api" - if: $CI_PIPELINE_SOURCE == "pipeline" - if: $CI_PIPELINE_SOURCE == "web" @@ -49,7 +49,7 @@ workflow: when: never - if: $CI_PIPELINE_SOURCE == "web" when: never - - if: $CI_COMMIT_REF_NAME == $MASTER_BRANCH_MANIFEST + - if: $CI_COMMIT_REF_NAME == $MASTER_BRANCH # -------------------------------------------------------------------------------------- # Stage: retrigger @@ -77,7 +77,7 @@ retrigger: --token=${GITBOT_TOKEN} --project=${PROJECT} --state=opened - --target-branch=${MASTER_BRANCH_MANIFEST} + --target-branch=${MASTER_BRANCH} --job=check ; done @@ -137,7 +137,7 @@ build:merge_request: --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} --commit=${CI_COMMIT_SHA} - --ref=^${MASTER_BRANCH_MANIFEST} || true | head -1) + --ref=^${MASTER_BRANCH} || true | head -1) # If pipeline exists, mirror its result - if [ ! -z "${MR_PIPELINE}" ]; then .gitlab-ci/scripts/mirror_pipeline_result.py @@ -151,5 +151,5 @@ build:merge_request: --gitlab-url=${CI_SERVER_URL} --token=${GITBOT_TOKEN} --project=${CI_PROJECT_PATH} - --ref=${MASTER_BRANCH_MANIFEST} + --ref=${MASTER_BRANCH} - fi diff --git a/scripts/deploy_gitlab_ci.py b/scripts/deploy_gitlab_ci.py index a24b45aed894c254b13001ef5c66ee45eadf6cb9..b05e770710d54a1481ace2b490c60aa23505b367 100755 --- a/scripts/deploy_gitlab_ci.py +++ b/scripts/deploy_gitlab_ci.py @@ -26,17 +26,12 @@ def read_keys_from_gitlab_ci_yml(gitlab_ci_yml): data = yaml.load(gitlab_ci_yml) logging.debug("Yaml: %s", data) - try: - masterbranch = data["variables"]["MASTER_BRANCH_PROJECT"] - logging.debug("Masterbranch %s", masterbranch) - except KeyError: - masterbranch = None try: recipe = data["variables"]["BB_RECIPE_NAME"] logging.debug("Recipe %s", recipe) except KeyError: recipe = None - return {"recipe": recipe, "masterbranch": masterbranch} + return {"recipe": recipe} def integrate_submodule_into(