Skip to content

Instantly share code, notes, and snippets.

@FrostyX
Last active July 14, 2017 09:09
Show Gist options
  • Save FrostyX/95f2089462a32feee9589004b6235096 to your computer and use it in GitHub Desktop.
Save FrostyX/95f2089462a32feee9589004b6235096 to your computer and use it in GitHub Desktop.
How to release foreman packages into Copr

Foreman in Copr

This document describes how the Copr projects for Foreman are created and how to build packages in them.

Copr projects

We've created two Copr projects.

When you open Monitor tab of those projects, you can see what packages are built here and in which chroots.

We used categories from tito.props of the foreman-packaging repo to determine which package should go where. Based on that we've re-built all packages from [foreman-nightly-fedora24] and [foreman-plugins-nightly-fedora24] into the @theforeman/foreman-nightly for only Fedora chroots.

Into same project we've re-built all packages from [foreman-nightly-nonscl-rhel7] and [foreman-plugins-nightly-nonscl-rhel7], but only into epel7 chroot.

Packages from categories [foreman-nightly-rhel7] and [foreman-plugins-nightly-rhel7] were built as software collection into @theforeman/tfm-foreman-nightly.

Tito

I suggest you to add tito releasers in following manner.

[copr]
releaser = tito.release.CoprReleaser
project_name = @theforeman/foreman-nightly

[copr-fedora]
releaser = tito.release.CoprReleaser
project_name = @theforeman/foreman-nightly
copr_options = -r fedora-24-x86_64 -r fedora-25-x86_64 -r fedora-26-x86_64 -r fedora-rawhide-x86_64

[copr-epel]
releaser = tito.release.CoprReleaser
project_name = @theforeman/foreman-nightly
copr_options = -r epel-7-x86_64

[copr-tfm]
releaser = tito.release.CoprReleaser
project_name = @theforeman/tfm-foreman-nightly
builder.scl = tfm

With such you can easily manage all of your package categories.

Build a package

When you open a package directory from packaging repo, submit its build into Copr by using one of the following commands

tito release copr
tito release copr-fedora
tito release copr-epel
tito release copr-tfm

Freezing a release

For freezing packages in a particular version, I would recommend a Copr forking feature. Possible scenarios

  1. You might want to create a repo with stable packages. E.g. fork foreman-nightly project as foreman-stable and at times fork new packages from the original project into it.
  2. You might want to freeze a project for a specific distro. E.g. fork tfm-foreman-nightly as tfm-foreman-el7 and let it live while continue building in the original project.

Mass rebuilding packages

In case that you want to rebuild a larger number of packages at once, you might consider copr-rebuild-tools. See how I used them for Foreman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment