smeserver-koji/plugins/tag2distrepo/README.md

68 lines
2.6 KiB
Markdown
Raw Normal View History

2024-11-14 00:58:43 +01:00
# tag2distrepo_sme
2024-09-27 10:19:51 +02:00
Koji plugin to automatically regenerate distrepos on tag operations
2024-11-14 00:58:43 +01:00
Koozali version which allows additional dist-repo settings
2024-09-27 10:19:51 +02:00
It uses the following options on a tag to control behaviour:
2024-11-15 00:30:11 +01:00
- `tag2distrepo.enabled`: set to "true" to enable automatic distrepos
- `tag2distrepo.keys`: set to a space-separated list of keys to use for distrepos
- `tag2distrepo.skip_missing_signatures`: set to "true" to skip unsigned packages (and not die)
- `tag2distrepo.allow_missing_signatures`: set to "true" to include packages with missing signatures
2024-09-27 10:19:51 +02:00
The tag must have at least one arch configured on it.
# Installing plugin on Koji Hub
2024-11-14 00:58:43 +01:00
1. Copy `tag2distrepo_sme.py` to `/usr/lib/koji-hub-plugins`
2024-09-27 10:19:51 +02:00
2. Edit the following settings in `/etc/koji-hub/hub.conf` to enable the plugin:
PluginPath = /usr/lib/koji-hub-plugins
2024-11-14 00:58:43 +01:00
Plugins = tag2distrepo_sme
2024-09-27 10:19:51 +02:00
3. Reload Apache
systemctl reload httpd
# Example usage
2024-11-15 01:33:55 +01:00
Here is an example of enabling the plugin on an "smeserver11" tag. Create the tag and ensure it has at least one arch and a package list (direct or inherited) so we can tag packages into it.
2024-09-27 10:19:51 +02:00
2024-11-14 00:58:43 +01:00
koji add-tag smeserver11 --arches=x86_64
koji add-pkg --owner kojiadmin smeserver11 bash
2024-09-27 10:19:51 +02:00
Set the extra options on the tag so the plugin will generate the repository:
2024-11-15 00:30:11 +01:00
koji edit-tag -x tag2distrepo.enabled=True -x tag2distrepo.keys=44922a28 -x tag2distrepo=skip_missing_signatures=True smeserver11
2024-09-27 10:19:51 +02:00
Tag a new build to trigger the plugin:
2024-11-14 00:58:43 +01:00
koji tag smeserver11 bash-5.0.17-2.el8.sme
2024-09-27 10:19:51 +02:00
The hub will immediately queue a new distRepo task, using the tagBuild task host as the distRepo task owner. When the distRepo task completes, you can find the new repository under the ``topurl`` for your Koji instance.
To confirm that the tag has the correct options set, use the `koji taginfo` command:
2024-11-15 00:30:11 +01:00
$ koji taginfo smeserver11
Tag: smeserver11 [39]
2024-09-27 10:19:51 +02:00
Arches: x86_64
Tag options:
2024-11-15 00:30:11 +01:00
tag2distrepo.enabled : True
tag2distrepo.keys : '44922a28'
tag2distrepo:skip_missing_signatures : True
2024-09-27 10:19:51 +02:00
To disable the plugin for the same tag:
2024-11-14 00:58:43 +01:00
koji edit-tag -r tag2distrepo_sme.enabled smeserver11
2024-09-27 10:19:51 +02:00
# Using Multiple Keys
If you want to create a repository that contains builds signed by more than one key, list your desired key IDs ordered by preference.
For example:
2024-11-15 00:30:11 +01:00
koji edit-tag smecontribs11 -x tag2distrepo.keys="44922a28 9867c58f 38ab71f4 5323552a"
2024-09-27 10:19:51 +02:00
2024-11-14 00:58:43 +01:00
For each RPM in the tag, Koji will use the first signed copy that it finds. In other words, Koji will try the first key (`44922a28`), and if Koji does not have the first key's signature for that RPM, then it will try the second key (`9867c58f`), third key (`38ab71f4`), and so on.