Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: seperate mock configs #1599

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 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
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.

37 changes: 11 additions & 26 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
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
Loading