Skip to content

Commit

Permalink
Use zuul clonned repos for upstream in build_openstack_packages role
Browse files Browse the repository at this point in the history
In build_openstack_packages role for building rpms from gerrit and
github, we are clonning the repo and checking out specific change.

With these tasks, we are not able to build dlrn rpms if we have multiple
prs/crs from same project.

But we want to build rpms from all changes.
In order to fix, Zuul knows how to checkout proper repos
with changes under test and from Depends-on.

DLRN always looks for clonned repos in DLRN data directory.
In order to use zuul clonned sources with DLRN, We are creating
symlink to dlrn data project directory and let's dlrn do the job.

Signed-off-by: Chandan Kumar (raukadah) <[email protected]>
  • Loading branch information
raukadah committed Feb 26, 2025
1 parent 114ecc5 commit 4ac08a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'project': item.project.name,
'branch': item.branch,
'change': item.change,
'src_dir': item.project.src_dir,
'refspec': '/'.join(['refs', 'changes',
item.change[-2:],
item.change,
Expand Down
26 changes: 6 additions & 20 deletions roles/build_openstack_packages/tasks/run_dlrn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,15 @@
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
version: '{{ _change.branch }}'

- name: "Clone {{ project_name_mapped.stdout }} from Github" # noqa: name[template]
- name: "Symlink {{ project_name_mapped.stdout }} from Zuul clonned repos" # noqa: name[template]
when:
- cifmw_bop_openstack_project_path | length == 0
- not repo_status.stat.exists
- "'host' in _change"
- "'github.com' in _change.host"
ansible.builtin.git:
repo: '{{ _change.host }}/{{ _change.project }}'
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
version: 'origin/pr/{{ _change.change }}/head'

- name: "Clone Openstack {{ project_name_mapped.stdout }}" # noqa: name[template]
when:
- cifmw_bop_openstack_project_path | length == 0
- not repo_status.stat.exists
- "'host' in _change"
- "'opendev' in _change.host"
ansible.builtin.git:
repo: '{{ _change.host }}/{{ _change.project }}'
dest: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
refspec: "{{ _change.refspec }}"
version: 'FETCH_HEAD'
- "'src_dir' in _change"
ansible.builtin.file:
src: '{{ ansible_user_dir }}/{{ _change.src_dir }}'
path: '{{ cifmw_bop_build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
state: link

- name: "Update packages.yml to use zuul repo for {{ project_name_mapped.stdout }}" # noqa: name[template], command-instead-of-module
vars:
Expand Down

0 comments on commit 4ac08a8

Please sign in to comment.