Skip to content

Working with CBS

Working with CBS

The following variables are used in this guide:

$sig = kmods
$release = 8 or 8s
$project = packages
$version = main or rebuild
$disttag = el$release
$mirror-release = 8 or 8-stream
$basearch = aarch64, ppc64le, or x86_64

$user = Your CentOS account (
$package = The package you are working on

Some of these variables are SIG specific, i.e. some might need to be changed in case you are not working on the Kmods SIG.


First you need to install required tools:

dnf install centos-packager

For authentication it is required to generate a TLS certificate:

centos-cert -u $user

In addition it is required to have a local copy of centos-git-common

git clone

To ease using these tools, add your local copy of centos-git-common to PATH.

New packages have to be added to the SIG's tags:

for tag in $sig$release-$project-$version-{candidate,testing,release}
    cbs add-pkg --owner=$user $tag $package

Request a repository to be created for your package on by opening an issue with centos-infra.

Upload package sources

Assuming you already have the repository on, we only need to add a new remote:

git remote add ssh://$package.git

Push the dist-git to

git push c$release-sig-$sig

Upload source files to lookaside cache:

git checkout c$release-sig-$sig
while read -r HASH FILE
    if [[ $HASH != $(sha1sum $FILE | awk '{print $1}') ]]
        echo "Hash values do not match." 1>&2
        echo "Hash for comparison: $HASH"
        lookaside_upload -f $FILE -n $package -b c$release-sig-$sig
done < .$package.metadata
Building a package
(Optional) Scratch Build:
git checkout c$release-sig-$sig
rpmbuild --define "%_topdir `pwd`" -bs SPECS/$package.spec

cbs build --scratch $sig$release-$project-$version-$disttag SRPMS/$package-*.src.rpm

Scratch builds will show up in the CBS web interface, and the built RPMS will be downloadable from there, but the package will not be included in any of the CBS tags (or the repos generated from the tags). Scratch builds are used to test functionality before doing a proper tagged build.

Tagged Build:
cbs build $sig$release-$project-$version-$disttag git+$package.git#$(git rev-parse c$release-sig-$sig)

Tagged builds will end up in the -candidate tag after it's finished building, and will be available in the buildroot in case other packages depend on it.

Releasing a package

There are 2 points in the process where packages can be promoted for wider consumption. Testing content can be distributed to the content delivery network for developers and CI systems to consume. Release-ready content can be promoted to a SIG-specific directory on for consumption by end-users. A push of packages to these can be triggered by tag-build packages.

Pushing test content to
cbs tag-build $sig$release-$project-$version-testing $package-$(rpm -q --specfile --define 'dist %{nil}' --qf="%|epoch?{%{epoch}:}:{}|%{version}-%{release}\n" SPECS/$package.spec).$disttag

Packages will be pushed to:$mirror-release/$sig/$basearch/$project-$version/
Releasing content to
cbs tag-build $sig$release-$project-$version-release $package-$(rpm -q --specfile --define 'dist %{nil}' --qf="%|epoch?{%{epoch}:}:{}|%{version}-%{release}\n" SPECS/$package.spec).$disttag

RPMs will be pushed to:$mirror-release/$sig/$basearch/$project-$version/

SRPMs will be pushed to:$mirror-release/$sig/Source/$project-$version/

Debuginfo will be pushed to:$mirror-release/$sig/$basearch/
Back to top