From 9d3bf6d1a8b35b8205e83e7d899b8f0e81457faa Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jun 04 2021 09:24:22 +0000 Subject: [PATCH 1/2] Add centpkg-fetch-sources --- diff --git a/roles/centpkg-fetch-sources/defaults/main.yaml b/roles/centpkg-fetch-sources/defaults/main.yaml new file mode 100644 index 0000000..fa087c2 --- /dev/null +++ b/roles/centpkg-fetch-sources/defaults/main.yaml @@ -0,0 +1 @@ +release: c9s diff --git a/roles/centpkg-fetch-sources/tasks/main.yaml b/roles/centpkg-fetch-sources/tasks/main.yaml new file mode 100644 index 0000000..b85f754 --- /dev/null +++ b/roles/centpkg-fetch-sources/tasks/main.yaml @@ -0,0 +1,19 @@ +--- +- name: Install system dependencies + yum: + name: centpkg + state: latest + become: true + +- name: Set origin and tracking branch + command: "{{ item }}" + args: + chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" + loop: + - git remote set-url origin https://gitlab.com/redhat/centos-stream/rpms/{{ zuul.project.name }} + - git branch -u origin/{{ release }} + +- name: Build the package SRPM + command: centpkg sources + args: + chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" From e709e9ba3a0139bcb1e9efa62881b7f4e6807730 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jun 04 2021 09:32:00 +0000 Subject: [PATCH 2/2] Add switch for mock-srpm-build to not fetch sources --- diff --git a/roles/mock-srpm-build/defaults/main.yaml b/roles/mock-srpm-build/defaults/main.yaml index f4ce64a..4e330b2 100644 --- a/roles/mock-srpm-build/defaults/main.yaml +++ b/roles/mock-srpm-build/defaults/main.yaml @@ -1,2 +1,3 @@ zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" mock_config: fedora-rawhide-x86_64 +no_fetch_sources: true diff --git a/roles/mock-srpm-build/tasks/main.yaml b/roles/mock-srpm-build/tasks/main.yaml index 1063ef3..fb7c020 100644 --- a/roles/mock-srpm-build/tasks/main.yaml +++ b/roles/mock-srpm-build/tasks/main.yaml @@ -21,6 +21,7 @@ shell: > spectool -g -C {{ ansible_user_dir }}/{{ zuul.project.src_dir }} {{ ansible_user_dir }}/{{ zuul.project.src_dir }}/*.spec + when: not {{ no_fetch_sources|default(false) }} - name: Init the mock chroot command: mock {{ mock_opts }} --init