Skip to content

Building an RPM in an OBS branch package

Alexander Graul edited this page Feb 20, 2026 · 15 revisions

Building an RPM in my OBS branch

Using the addition of a docker logout step after interacting with docker registries. The only impact this has is on which package needs to be re-built with my changes.

Note: Requires uyuni-releng-tools.

Build RPM in OBS branch

  1. Change code and git commit
  2. cd susemanager-utils/susemanager-sls (path can be read from rel-eng/packages/susemanager-sls)
  3. osc branch systemsmanagement:Uyuni:Master susemanager-sls
  4. (not needed when direnv is used) export OSCAPI=https://api.opensuse.org TEST=1 OBS_PROJ=home:agraul:branches:systemsmanagement:Uyuni:Master
  5. build-packages-for-obs susemanager-sls (set NOCPIO=1 to create tar archives instead of cpio archives )
  6. push-packages-to-obs susemanager-sls

Direnv .envrc for *-packages-*-obs.sh

Setting the default OBS instance and project via a .envrc:
% cat >.envrc <<EOF
export OSCAPI=https://api.opensuse.org
export OBS_PROJ=home:agraul:branches:systemsmanagement:Uyuni:Master'
export TEST=1
export NOCPIO=1
EOF
% direnv allow

Rebuild server-image container

Uyuni Server packages are not directly installed on the Uyuni Server. Instead, they are included in the uyuni-server container. This container is built in OBS, the source package is called server-image. To try the branched RPM, the server-image needs to be rebuilt.

When OBS builds the server-image, it resolves the dependencies listed in the Dockerfile. OBS first tries to find the dependencies in the same project that server-image is built in and only if it can’t find them, it looks at the projects mentioned in the repository configuration.

To build server-image and include the branched susemanager-sls, all you have to do is to osc link systemsmanagement:Uyuni:Master server-image $OBS_PROJ.

Publish server-image container to registry

By default, osc branch creates a project that does not publish the built artifacts (RPMs, container images etc.). Publishing can be enabled through the WebUI or by editing the project meta configuration.

WebUI

  1. Visit https://build.opensuse.org/repositories/$OBS_PROJ with a web browser
  2. Toggle Publish Flag for containerfile repository

Terminal

  1. osc meta proj -e $OBS_PROJ (opens $EDITOR)
  2. Change the XML Element <publish>...</publish>. From
    <project name="home:agraul:branches:systemsmanagement:Uyuni:Master">
      <title>Branch project for package susemanager-sls</title>
      <description>This project was created for package susemanager-sls via attribute OBS:Maintained</description>
      <person userid="agraul" role="maintainer"/>
      <publish>
        <disable/>
      </publish>
      </repository name="..."">
      [...]
    </project>
        

    to

    <project name="home:agraul:branches:systemsmanagement:Uyuni:Master">
      <title>Branch project for package susemanager-sls</title>
      <description>This project was created for package susemanager-sls via attribute OBS:Maintained</description>
      <person userid="agraul" role="maintainer"/>
      <publish>
        <disable/>
        <enable repository="containerfile"/>
      </publish>
      </repository name="..."">
      [...]
    </project>
        
  3. Save the file and quit the editor. osc will upload the updated project meta configuration.

Use branched server-image

Find the image repository for your server-image in the container registry.

  1. Visit https://registry.opensuse.org/cgi-bin/cooverview
  2. Search for project=^$OBS_PROJ (e.g. project=^home:agraul:branches:systemsmanagement:Uyuni:Master)
  3. Click on the container image for the wanted architecture
  4. In the row for the latest tag, click on “Copy to clipboard”
  5. ssh root@uyuni-server-vm.virt
  6. mgradm upgrade podman --pullPolicy=Always --image=<insert from clipboard, remove the leading podman pull>

Clone this wiki locally