diff --git a/.gitlab-ci b/.gitlab-ci index 77ada04ca6e1517ef1cca903a804880f5aea8843..04cd24f23863acb3ff54535ec166c0c7734abe4e 160000 --- a/.gitlab-ci +++ b/.gitlab-ci @@ -1 +1 @@ -Subproject commit 77ada04ca6e1517ef1cca903a804880f5aea8843 +Subproject commit 04cd24f23863acb3ff54535ec166c0c7734abe4e diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 455dffef369a39a03fbcf4ff7ca153b6c1484568..3a5857188ce06327ef3de7ec9ce66ce2ac39d950 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,117 +1,8 @@ +--- # --------------------------------------------------------------------------------------- -# Global +# Include the default CI steps from the gitlab-ci repo # --------------------------------------------------------------------------------------- -image: "${CI_IMAGES}/python/3.9:99e363bc5feaa27ff18dbe7731a76ff04d7d0deb" - -stages: - - integrate - - merge - - build - - check - -variables: - # CI_IMAGES_BASEPATH: Environment variable configure in gitlab - CI_IMAGES: ${CI_IMAGES_BASEPATH}/ci-images - # Include git submodules - GIT_SUBMODULE_STRATEGY: recursive - # 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 - # 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: dunfell - -workflow: - rules: - # Do not run pipelines on forked projects - - if: $CI_PROJECT_PATH == "SECO-Northern-Europe/yocto/layers/meta-guf-machine" - && $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID - -# --------------------------------------------------------------------------------------- -# Stage: integrate -# --------------------------------------------------------------------------------------- -integrate: - stage: integrate - rules: - # 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 - tags: - - infrastructure - timeout: 2m - cache: - policy: push - script: - - cd ${CI_PROJECT_DIR} - - .gitlab-ci/integrate_into_manifest.py - --gitlab-url=${CI_SERVER_URL} - --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} - --integration-base=${MASTER_BRANCH} - --project=${CI_PROJECT_PATH} - --merge-request=${CI_MERGE_REQUEST_IID} - --save-revision-to=manifest_revision - artifacts: - paths: - - manifest_revision - -# --------------------------------------------------------------------------------------- -# Stage: merge -# --------------------------------------------------------------------------------------- -merge: - stage: merge - rules: - - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH - tags: - - infrastructure - timeout: 3m - script: - - cd ${CI_PROJECT_DIR} - - .gitlab-ci/merge_into_manifest.py - --gitlab-url=${CI_SERVER_URL} - --token=${GITBOT_TOKEN} - --manifest-project=${MANIFEST_PROJECT} - --master-branch=${MASTER_BRANCH} - --project=${CI_PROJECT_PATH} - --commit=${CI_COMMIT_SHA} - --save-revision-to=manifest_revision - artifacts: - paths: - - manifest_revision - -# --------------------------------------------------------------------------------------- -# Stage: build -# --------------------------------------------------------------------------------------- -build: - stage: build - rules: - - if: $CI_MERGE_REQUEST_IID - trigger: - project: SECO-Northern-Europe/yocto/manifest - branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}" - strategy: depend - -# --------------------------------------------------------------------------------------- -# Stage: check -# --------------------------------------------------------------------------------------- -check: - stage: check - rules: - - if: $CI_MERGE_REQUEST_IID - needs: ["integrate"] - tags: - - infrastructure - timeout: 2m - script: - - cd ${CI_PROJECT_DIR} - - .gitlab-ci/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} - --project=${CI_PROJECT_PATH} - --merge-request=${CI_MERGE_REQUEST_IID} +include: + - project: '${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/gitlab-ci' + ref: 04cd24f23863acb3ff54535ec166c0c7734abe4e + file: 'manifest-integration.yml'