Skip to content

vlotorev/zuul-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tools for Zuul CI

submodule.py is a tool to replace super project submodules with corresponding zuul.projects.

Usage

Zuul job that must be run for super project should have:

  • super project as required project,
  • super_project dictionary with zuul.project:
- job:
  ...
  required-projects:
    - <super-project>
  vars:
    super_project: "{{ zuul.projects['<super-project'] }}"

Job should run playbook that restores remote for super project, so that:

  • .gitmodules entries can be matched with canonical names of zuul.projects.
  • submodules that are missing in zuul.projects can be cloned from remote.

After that job runs tasks that dump zuul variable into zuul.json and run submodule.py:

tasks:
  - name: Restore remote for projects  # noqa 303
    # setup remote as zuul intentionally removes remote
    loop: "{{ zuul.projects | dict2items }}"
    command: git -C {{ item.value.src_dir }} remote set-url origin \
       ssh://{{ item.value.canonical_hostname }}:29418/{{ item.value.name }}

  - name: Dump zuul.json variable
    copy: content={{ zuul | to_nice_json }} dest=zuul.json

  - name: Prepare submodules
    command: submodule.py zuul.json {{ super_project.canonical_name }} --verbose --recursive

About

Extra tools for Zuul

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages