Skip to content

Commit

Permalink
feat: seperate mock configs (terrapkg#1599)
Browse files Browse the repository at this point in the history
* feat: seperate mock configs

* i am not cappy

* ci: clone main from mock-configs

(cherry picked from commit da92fc7)

# Conflicts:
#	.github/workflows/autobuild.yml
#	anda/terra/mock-configs/terra-mock-configs.spec
  • Loading branch information
lleyton committed Jul 23, 2024
1 parent 19616a3 commit c9509c5
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 293 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,27 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout latest Mock configs
uses: actions/checkout@v4
with:
repository: terrapkg/mock-configs
path: mock-configs

- name: Set up git repository
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Include custom build template instead of package default
run: |
cp -v anda/terra/mock-configs/terra.tpl /etc/mock/templates/terra.tpl
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
- name: Build with Andaman
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c anda/terra/mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg

- name: Build with Andaman (alternate arch)
if: |
matrix.pkg.arch == 'x86_64' && matrix.pkg.labels['multilib']
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c anda/terra/mock-configs/terra-${{ matrix.version }}-i386.cfg
matrix.pkg.arch == 'x86_64' && matrix.pkg.labels['multilib']
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-i386.cfg

- name: Generating artifact name
id: art
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,22 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout latest Mock configs
uses: actions/checkout@v4
with:
repository: terrapkg/mock-configs
path: mock-configs

- name: Set up git repository
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Cache buildroot
id: br-cache
uses: actions/cache@v4
with:
path: /var/cache
key: ${{ runner.os }}-br-${{ matrix.version }}-${{ matrix.arch }}-${{ matrix.pkg }}
- name: Include custom build template instead of package default
run: |
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
- name: Build with Andaman
run: anda build anda/${{ matrix.pkg }}pkg --package rpm -c anda/terra/mock-configs/terra-${{ matrix.version }}-${{ matrix.arch }}.cfg
run: anda build anda/${{ matrix.pkg }}pkg --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.arch }}.pkg

- name: Generating artifact name
id: art
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/json-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout latest Mock configs
uses: actions/checkout@v4
with:
repository: terrapkg/mock-configs
path: mock-configs

- name: Set up git repository
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Cache buildroot
id: br-cache
uses: actions/cache@v4
with:
path: /var/cache
key: ${{ runner.os }}-br-${{ matrix.version }}-${{ matrix.pkg.arch }}-${{ matrix.pkg.pkg }}
- name: Include custom build template instead of package default
run: |
cp -v mock-configs/terra.tpl /etc/mock/templates/terra.tpl
- name: Build with Andaman
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c anda/terra/mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.cfg
run: anda build ${{ matrix.pkg.pkg }} --package rpm -c mock-configs/terra-${{ matrix.version }}-${{ matrix.pkg.arch }}.pkg

- name: Generating artifact name
id: art
Expand Down
5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-39-aarch64.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-39-i386.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-39-x86_64.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-40-aarch64.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-40-i386.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-40-x86_64.cfg

This file was deleted.

39 changes: 12 additions & 27 deletions anda/terra/mock-configs/terra-mock-configs.spec
Original file line number Diff line number Diff line change
@@ -1,60 +1,45 @@
Name: terra-mock-configs
Version: 11
Release: 2%{?dist}
Version: 1.0.0
Release: 1%{?dist}
Epoch: 1
Summary: Mock configs for Terra repos

License: MIT
URL: https://terra.fyralabs.com
Source0: terra.tpl
Source3: terra-39-x86_64.cfg
Source4: terra-39-aarch64.cfg
Source5: terra-40-x86_64.cfg
Source6: terra-40-aarch64.cfg
Source7: terra-40-i386.cfg
Source8: terra-39-i386.cfg
Source9: terra-rawhide-x86_64.cfg
Source10: terra-rawhide-aarch64.cfg
Source11: terra-rawhide-i386.cfg
URL: https://github.com/terrapkg/mock-configs
Source0: %url/archive/refs/tags/v%version.tar.gz

BuildRequires: mock-core-configs
Requires: mock-core-configs
BuildArch: noarch

Provides: anda-mock-configs = %{version}-%{release}
Provides: anda-mock-configs = %{epoch}:%{version}-%{release}
Obsoletes: anda-mock-configs < 3-2%{?dist}

%description
%{summary}

%prep
%autosetup -n mock-configs-%version

%build


%install
mkdir -p %{buildroot}%{_sysusersdir}
mkdir -p %{buildroot}%{_sysconfdir}/mock/templates

cp -v %{SOURCE0} %{buildroot}%{_sysconfdir}/mock/templates/
cp -v %{SOURCE3} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE4} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE5} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE6} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE7} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE8} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE9} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE10} %{buildroot}%{_sysconfdir}/mock/
cp -v %{SOURCE11} %{buildroot}%{_sysconfdir}/mock/

cp -v terra.tpl %{buildroot}%{_sysconfdir}/mock/templates/
cp -v *.cfg %{buildroot}%{_sysconfdir}/mock/

%files
%config %{_sysconfdir}/mock/templates/terra.tpl
%config %{_sysconfdir}/mock/terra-*-x86_64.cfg
%config %{_sysconfdir}/mock/terra-*-aarch64.cfg
%config %{_sysconfdir}/mock/terra-*-i386.cfg


%changelog
* Mon Jul 22 2024 Lleyton Gray <[email protected]> - 1:1.0.0-1
- Migrate to pulling configs from an external repository

* Thu Jul 18 2024 Cappy Ishihara <[email protected]> - 11-1
- Include multilib mock files for x86-based systems (backwards compatibility)

Expand Down
5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-rawhide-aarch64.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-rawhide-i386.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions anda/terra/mock-configs/terra-rawhide-x86_64.cfg

This file was deleted.

Loading

0 comments on commit c9509c5

Please sign in to comment.