PR#400 per-tag configuration of chroot mock behaviour

Merges #400
https://pagure.io/koji/pull-request/400
Fixes #398
https://pagure.io/koji/issue/398
This commit is contained in:
Mike McLean 2017-06-23 17:26:39 -04:00
commit 01277c131b
2 changed files with 24 additions and 0 deletions

View file

@ -364,6 +364,11 @@ class BuildRoot(object):
#if self.options.debug_mock:
# cmd.append('--debug')
# TODO: should we pass something like --verbose --trace instead?
if 'mock.new_chroot' in self.config['extra']:
if self.config['extra']['mock.new_chroot']:
cmd.append('--new-chroot')
else:
cmd.append('--old-chroot')
cmd.extend(args)
self.logger.info(' '.join(cmd))
workdir = getattr(self, 'workdir', None)

View file

@ -403,6 +403,25 @@ for example to get the latest buildroot for dist-f12-build run
you will need to pass in --topurl=https://kojipkgs.fedoraproject.org/ to
any mock-config command to get a working mock-config from fedoras koji.
Tuning mock's behaviour per tag
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Few options for mock can be configured per-tag. These options are stored in
tag info's *extra* field. Extra values can be checked via `koji taginfo`
command. Example for forcing `dnf` usage in specific build
environment follows:
::
koji edit-tag dnf-fedora-tag -x mock.package_manager=dnf
* `mock.package_manager` - If this is set, it will override mock's default
package manager. Typically used with `yum` or `dnf` values.
* `mock.new_chroot` - 0/1 value. If it is set, `--new-chroot` or
`--old-chroot` option is appended to any mock call. If it is not set,
mock's default behaviour is used.
Using Koji to control tasks
^^^^^^^^^^^^^^^^^^^^^^^^^^^