Skip to content

Building an RPM or images in an OBS branch

Cedric Bosdonnat edited this page Jun 22, 2026 · 1 revision

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 and a gitea account setup for the Git workflow.

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 fork systemsmanagement:Uyuni:Main susemanager-sls
  4. (not needed when direnv is used) export GIT_SRV=src.opensuse.org GIT_ORG=<gitea_user> BRANCH=uyuni-main TEST=1
  5. build-packages-for-obs susemanager-sls
  6. push-packages-to-git susemanager-sls

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

Setting the default OBS instance and project via a .envrc:
% cat >.envrc <<EOF
export GIT_SRV=src.opensuse.org
export GIT_ORG=<gitea_user>'
export TEST=1
export BRANCH=uyuni-main
export GIT_PRODUCT_REPO=Uyuni
EOF
% direnv allow

Build image in OBS branch

  1. Change code and git commit
  2. cd containers/server-postgresql-image (path can be read from rel-eng/packages/server-postgresql-image)
  3. osc fork systemsmanagement:Uyuni:Main server-postgresql-image
  4. (not needed when direnv is used) export GIT_SRV=src.opensuse.org GIT_ORG=<gitea_user> BRANCH=uyuni-main TEST=1 GIT_PRODUCT_REPO=Uyuni
  5. build-packages-for-obs server-postgresql-image
  6. push-images-to-git server-postgresql-image

The difference with pushing RPMs is that the GIT_PRODUCT_REPO variable is needed and the script to push is push-images-to-git.

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 fork systemsmanagement:Uyuni:Main server-image.

Publish server-image container to registry

By default, osc fork 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 prj -e $OBS_PROJ (opens $EDITOR)
  2. Change the XML Element <publish>...</publish>. From
    <project name="home:<obsuser>: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="<obsuser>" role="maintainer"/>
      <publish>
        <disable/>
      </publish>
      </repository name="..."">
      [...]
    </project>
        

    to

    <project name="home:<obsuser>: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="<obsuser>" 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:<obsuser>: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