-
Notifications
You must be signed in to change notification settings - Fork 249
Building an RPM or images in an 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.
- Change code and
git commit -
cd susemanager-utils/susemanager-sls(path can be read fromrel-eng/packages/susemanager-sls) osc fork systemsmanagement:Uyuni:Main susemanager-sls- (not needed when direnv is used)
export GIT_SRV=src.opensuse.org GIT_ORG=<gitea_user> BRANCH=uyuni-main TEST=1 build-packages-for-obs susemanager-slspush-packages-to-git susemanager-sls
.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- Change code and
git commit -
cd containers/server-postgresql-image(path can be read fromrel-eng/packages/server-postgresql-image) osc fork systemsmanagement:Uyuni:Main server-postgresql-image- (not needed when direnv is used)
export GIT_SRV=src.opensuse.org GIT_ORG=<gitea_user> BRANCH=uyuni-main TEST=1GIT_PRODUCT_REPO=Uyuni build-packages-for-obs server-postgresql-imagepush-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.
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.
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.
- Visit https://build.opensuse.org/repositories/$OBS_PROJ with a web browser
- Toggle Publish Flag for containerfile repository
-
osc meta prj -e $OBS_PROJ(opens$EDITOR) - 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>
- Save the file and quit the editor.
oscwill upload the updated project meta configuration.
Find the image repository for your server-image in the container registry.
- Visit https://registry.opensuse.org/cgi-bin/cooverview
- Search for
project=^$OBS_PROJ(e.g.project=^home:<obsuser>:branches:systemsmanagement:Uyuni:Master) - Click on the container image for the wanted architecture
- In the row for the
latesttag, click on “Copy to clipboard” ssh root@uyuni-server-vm.virtmgradm upgrade podman --pullPolicy=Always --image=<insert from clipboard, remove the leading podman pull>