Skip to content
Snippets Groups Projects
Commit b699b616 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

CI: Add integration trigger

parent 6620e3f8
No related branches found
No related tags found
No related merge requests found
Pipeline #8854 failed with stages
in 1 minute and 11 seconds
...@@ -18,8 +18,8 @@ default: ...@@ -18,8 +18,8 @@ default:
stages: stages:
- analyze - analyze
- deploy-test
- deploy - deploy
- integrate
workflow: workflow:
rules: rules:
...@@ -58,58 +58,83 @@ yamllint: ...@@ -58,58 +58,83 @@ yamllint:
# Stage: deploy-test # Stage: deploy-test
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
deploy-foobar-manifest: deploy-foobar-manifest:
stage: deploy-test stage: deploy
# when: manual variables:
allow_failure: true
script: script:
- cd ${CI_PROJECT_DIR} - cd ${CI_PROJECT_DIR}
- if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then MERGE="--merge"; else MERGE=""; fi
- PROJECT_ROOT="${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/ci-test" - PROJECT_ROOT="${CI_PROJECT_ROOT_NAMESPACE}/yocto/infrastructure/ci-test"
- ./deploy_gitlab_ci.py - ./deploy_gitlab_ci.py
--gitlab-url=${CI_SERVER_URL} --gitlab-url=${CI_SERVER_URL}
--token=${GITBOT_TOKEN} --token=${GITBOT_TOKEN}
--submodule=.gitlab-ci --submodule=.gitlab-ci
--revision=${CI_COMMIT_SHA} --revision=${CI_COMMIT_SHA}
${MERGE}
--manifest-project=${PROJECT_ROOT}/minimal-manifest --manifest-project=${PROJECT_ROOT}/minimal-manifest
${PROJECT_ROOT}/minimal-foo ${PROJECT_ROOT}/minimal-foo
${PROJECT_ROOT}/minimal-bar ${PROJECT_ROOT}/minimal-bar
- ./create_gitlab_ci_jobs.py
--branch="integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}"
--manifest-project=${PROJECT_ROOT}/minimal-manifest
${PROJECT_ROOT}/minimal-foo
${PROJECT_ROOT}/minimal-bar
> integration-jobs.yml
artifacts:
paths:
- integration-jobs.yml
trigger-child:
stage: integrate
trigger:
include:
- artifact: integration-jobs.yml
job: deploy-foobar-manifest
# project: SECO-Northern-Europe/yocto/infrastructure/ci-test/minimal-bar
# branch: "integrate/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}"
# strategy: depend
#
# minimal-bar: *integrate
# minimal-foo: *integrate
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
# Stage: deploy # Stage: deploy
# --------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------
.deploy: &deploy # .deploy: &deploy
stage: deploy # stage: deploy
when: manual # when: manual
allow_failure: true # allow_failure: true
script: # script:
- cd ${CI_PROJECT_DIR} # - cd ${CI_PROJECT_DIR}
- if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then MERGE="--merge"; else MERGE=""; fi # - if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then MERGE="--merge";
- ./deploy_gitlab_ci.py # else MERGE=""; fi
--gitlab-url=${CI_SERVER_URL} # - ./deploy_gitlab_ci.py
--token=${GITBOT_TOKEN} # --gitlab-url=${CI_SERVER_URL}
--project=${CI_PROJECT_ROOT_NAMESPACE}/${CI_JOB_NAME} # --token=${GITBOT_TOKEN}
--submodule=.gitlab-ci # --project=${CI_PROJECT_ROOT_NAMESPACE}/${CI_JOB_NAME}
--revision=${CI_COMMIT_SHA} # --submodule=.gitlab-ci
${MERGE} # --revision=${CI_COMMIT_SHA}
# ${MERGE}
3rd-party/kuk/uboot-imx-kuk: *deploy #
kernel/linux-guf: *deploy
kernel/linux-imx-kuk: *deploy # 3rd-party/kuk/uboot-imx-kuk: *deploy
kernel/modules/egalaxi2c: *deploy # kernel/linux-guf: *deploy
kernel/modules/gfplatdetect: *deploy # kernel/linux-imx-kuk: *deploy
tools/gf-emc-test-suite: *deploy # kernel/modules/egalaxi2c: *deploy
tools/gf-productiontests: *deploy # kernel/modules/gfplatdetect: *deploy
tools/gfeeprom: *deploy # tools/gf-emc-test-suite: *deploy
tools/gfxml2dto: *deploy # tools/gf-productiontests: *deploy
tools/guf-show-demo: *deploy # tools/gfeeprom: *deploy
tools/libmdb: *deploy # tools/gfxml2dto: *deploy
tools/touchcal-conv: *deploy # tools/guf-show-demo: *deploy
tools/xconfig: *deploy # tools/libmdb: *deploy
yocto/config: *deploy # tools/touchcal-conv: *deploy
yocto/infrastructure/ci-test/minimal-bar: *deploy # tools/xconfig: *deploy
yocto/infrastructure/ci-test/minimal-foo: *deploy # yocto/config: *deploy
yocto/infrastructure/ci-test/minimal-manifest: *deploy # yocto/infrastructure/ci-test/minimal-bar: *deploy
yocto/layers/meta-guf-distro: *deploy # yocto/infrastructure/ci-test/minimal-foo: *deploy
yocto/layers/meta-guf-machine: *deploy # yocto/infrastructure/ci-test/minimal-manifest: *deploy
yocto/manifest: *deploy # yocto/layers/meta-guf-distro: *deploy
# yocto/layers/meta-guf-machine: *deploy
# yocto/manifest: *deploy
#!/usr/bin/env python3
import argparse
import logging
import sys
from ruamel.yaml import YAML
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--project",
"--manifest-project",
help="""name of the GitLab project""",
dest="project",
)
parser.add_argument(
"--branch",
help="""integration branch""",
dest="branch",
required=True,
)
parser.add_argument(
"--merge",
help="""if set, perform merge after integration""",
dest="merge",
action="store_true",
required=False,
default=False,
)
parser.add_argument(
"projects",
help="""List of projects the change should be deployed to additionally
to the manifest project given as named parameter.""",
nargs="*",
)
parser.add_argument(
"-v",
"--verbose",
action="store_true",
help="""Increase verbosity.""",
)
args, _ = parser.parse_known_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
logging.debug("Integrate into: %s", args.project)
d = dict()
integration_jobs = []
for p in args.projects:
jobname = "integrate-{}".format(p.split("/")[-1])
integration_jobs.append(jobname)
d[jobname] = {
"stage": "integrate",
"trigger": {
"include": {
"project": p,
"branch": args.branch,
"strategy": "depend",
}
},
}
logging.debug(d)
yaml = YAML()
yaml.dump(d, sys.stdout)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment