Skip to content
Snippets Groups Projects

CI: Add function to merge the gitlab-ci MRs

Merged Tobias Kahlki requested to merge CI-test-multi-deploy into master
5 files
+ 350
40
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 74
39
@@ -20,6 +20,7 @@ stages:
- analyze
- deploy
- check
- merge
workflow:
rules:
@@ -57,12 +58,51 @@ yamllint:
# ---------------------------------------------------------------------------------------
# Stage: deploy-test
# ---------------------------------------------------------------------------------------
.foobar-manifest-projects:
variables:
PROJECT_ROOT:
${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/ci-test
MANIFEST_PROJECT:
${PROJECT_ROOT}/minimal-manifest
DEPLOY_TO:
${PROJECT_ROOT}/minimal-foo
${PROJECT_ROOT}/minimal-bar
.manifest-projects:
variables:
PROJECT_ROOT:
${CI_PROJECT_ROOT_NAMESPACE}
MANIFEST_PROJECT:
${PROJECT_ROOT}/yocto/manifest
DEPLOY_TO:
${PROJECT_ROOT}/3rd-party/kuk/uboot-imx-kuk
${PROJECT_ROOT}/kernel/linux-guf
${PROJECT_ROOT}/kernel/linux-imx-kuk
${PROJECT_ROOT}/kernel/modules/egalaxi2c
${PROJECT_ROOT}/kernel/modules/gfplatdetect
${PROJECT_ROOT}/tools/gf-emc-test-suite
${PROJECT_ROOT}/tools/gf-productiontests
${PROJECT_ROOT}/tools/gfeeprom
${PROJECT_ROOT}/tools/gfxml2dto
${PROJECT_ROOT}/tools/guf-show-demo
${PROJECT_ROOT}/tools/libmdb
${PROJECT_ROOT}/tools/touchcal-conv
${PROJECT_ROOT}/tools/xconfig
${PROJECT_ROOT}/yocto/config
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-bar
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-foo
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-manifest
${PROJECT_ROOT}/yocto/layers/meta-guf-distro
${PROJECT_ROOT}/yocto/layers/meta-guf-machine
.deploy:
stage: deploy
rules:
- if: $CI_MERGE_REQUEST_IID
script:
- cd ${CI_PROJECT_DIR}
- if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
MERGE="--merge"; else MERGE=""; fi
- ./deploy_gitlab_ci.py
--gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN}
@@ -70,7 +110,6 @@ yamllint:
--submodule=.gitlab-ci
--revision=${CI_COMMIT_SHA}
--verbose
${MERGE}
${DEPLOY_TO}
- ./generate_job_from_template.py
@@ -88,51 +127,23 @@ yamllint:
- integration.yml
deploy:
extends: .deploy
extends:
- .deploy
- .manifest-projects
rules:
# For now to test the merge step
- when: manual
allow_failure: true
variables:
PROJECT_ROOT:
${CI_PROJECT_ROOT_NAMESPACE}
MANIFEST_PROJECT:
${PROJECT_ROOT}/yocto/manifest
DEPLOY_TO:
${PROJECT_ROOT}/3rd-party/kuk/uboot-imx-kuk
${PROJECT_ROOT}/kernel/linux-guf
${PROJECT_ROOT}/kernel/linux-imx-kuk
${PROJECT_ROOT}/kernel/modules/egalaxi2c
${PROJECT_ROOT}/kernel/modules/gfplatdetect
${PROJECT_ROOT}/tools/gf-emc-test-suite
${PROJECT_ROOT}/tools/gf-productiontests
${PROJECT_ROOT}/tools/gfeeprom
${PROJECT_ROOT}/tools/gfxml2dto
${PROJECT_ROOT}/tools/guf-show-demo
${PROJECT_ROOT}/tools/libmdb
${PROJECT_ROOT}/tools/touchcal-conv
${PROJECT_ROOT}/tools/xconfig
${PROJECT_ROOT}/yocto/config
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-bar
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-foo
${PROJECT_ROOT}/yocto/infrastructure/ci-test/minimal-manifest
${PROJECT_ROOT}/yocto/layers/meta-guf-distro
${PROJECT_ROOT}/yocto/layers/meta-guf-machine
deploy-foobar:
extends: .deploy
variables:
PROJECT_ROOT:
${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/ci-test
MANIFEST_PROJECT:
${PROJECT_ROOT}/minimal-manifest
DEPLOY_TO:
${PROJECT_ROOT}/minimal-foo
${PROJECT_ROOT}/minimal-bar
extends:
- .deploy
- .foobar-manifest-projects
trigger:
stage: deploy
rules:
- if: $CI_MERGE_REQUEST_IID
needs: [deploy]
trigger:
include:
@@ -142,12 +153,36 @@ trigger:
trigger-foobar:
stage: deploy
rules:
- if: $CI_MERGE_REQUEST_IID
needs: [deploy-foobar]
trigger:
include:
- artifact: integration.yml
job: deploy-foobar
strategy: depend
# --------------------------------------------------------------------------------------
# Stage: merge
# --------------------------------------------------------------------------------------
.merge:
stage: merge
rules:
- if: $CI_COMMIT_BRANCH == "master"
script:
- cd ${CI_PROJECT_DIR}
- ./merge_gitlab_ci.py
--gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN}
--manifest-project=${MANIFEST_PROJECT}
--submodule=.gitlab-ci
--revision=${CI_COMMIT_SHA}
--verbose
${DEPLOY_TO}
merge-foobar:
extends:
- .merge
- .foobar-manifest-projects
# --------------------------------------------------------------------------------------
# Stage: check
Loading