[image-build] Use single koji task per variant

Given a list of arches, koji can build multiple images in one go
(automatically starting children tasks for each one).

This causes a bunch of changes:
 * The configuration no longer allows changing config based on
   architecture, only variants are allowed. It is however possible to
   filter which arches are used for the building in the variant.
 * The configuration files for koji image-build are stored in
   work/image-build/$variant (not split based on arch).

This patch also changes the option name that is passed to koji
image-build: the repos should be specified under key `repo` (without the
trailing slash).

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-01-05 09:27:20 +01:00
parent 88bb6ac3d7
commit 9c1418eb0a
8 changed files with 780 additions and 107 deletions

View file

@ -46,5 +46,39 @@ class TestGitRefResolver(unittest.TestCase):
run.assert_called_once_with(['git', 'ls-remote', 'https://git.example.com/repo.git', 'HEAD'])
class TestGetVariantData(unittest.TestCase):
def test_get_simple(self):
conf = {
'foo': {
'^Client$': 1
}
}
result = util.get_variant_data(conf, 'foo', mock.Mock(uid='Client'))
self.assertEqual(result, [1])
def test_get_make_list(self):
conf = {
'foo': {
'^Client$': [1, 2],
'^.*$': 3,
}
}
result = util.get_variant_data(conf, 'foo', mock.Mock(uid='Client'))
self.assertItemsEqual(result, [1, 2, 3])
def test_not_matching_arch(self):
conf = {
'foo': {
'^Client$': [1, 2],
}
}
result = util.get_variant_data(conf, 'foo', mock.Mock(uid='Server'))
self.assertItemsEqual(result, [])
def test_handle_missing_config(self):
result = util.get_variant_data({}, 'foo', mock.Mock(uid='Client'))
self.assertItemsEqual(result, [])
if __name__ == "__main__":
unittest.main()