From 1f70fbdd1bc0c120d483b0d0f78d86805ae06a7c Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: May 19 2020 20:57:54 +0000 Subject: Adding the ability to run compose on only certain builds Signed-off-by: Mohan Boddu --- diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py index 50d3574..8d4190f 100755 --- a/fedora-minimal-compose.py +++ b/fedora-minimal-compose.py @@ -13,6 +13,9 @@ logger.setLevel(logging.INFO) rawhide = '33' odcs_file = '/etc/releng-odcs-oidc-token' fmc_tag = f'f{rawhide}-minimal-compose' +packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux'] +# When we have the ability to run one compose for multiple builds, use the following list +# packages_list = ['anaconda', 'authconfig', 'python-blivet', 'pyparted', 'parted', 'pykickstart', 'blivet-gui', 'libblockdev', 'e2fsprogs', 'dosfstools', 'grub2', 'shim-signed', 'libselinux', 'chrony', 'fcoe-utils', 'hfsplus-tools', 'firewalld', 'realmd', 'yelp', 'libtimezonemap', 'kernel', 'systemd', 'dracut', 'plymouth', 'gtk3', 'python3'] class Consumer(object): """ @@ -84,19 +87,21 @@ class Consumer(object): logger.debug(message.topic) logger.debug(message.body) build = message.body['build']['nvr'] - - # Check if its rawhide only build - # TODO: Extend it to branched. - # Get the dist tag of the build - dist_tag = build[-4:] - - if f'fc{rawhide}' in dist_tag: - self.save_nvr_to_file(build) - # Pre compose koji tasks - self.run_koji_tasks(fmc_tag, build) - # Get odcs token - odcs_token = self.get_odcs_token(odcs_file) - # Run the compose - compose_info = self.run_compose(odcs_token) - # Inject the file to into the compose log dir - self.inject_builds_compose(compose_info) \ No newline at end of file + package = message.body['build']['name'] + # Check if the package is the one of the packages we are interested in + if package in packages_list: + # Check if its rawhide only build + # TODO: Extend it to branched. + # Get the dist tag of the build + dist_tag = build[-4:] + + if f'fc{rawhide}' in dist_tag: + self.save_nvr_to_file(build) + # Pre compose koji tasks + self.run_koji_tasks(fmc_tag, build) + # Get odcs token + odcs_token = self.get_odcs_token(odcs_file) + # Run the compose + compose_info = self.run_compose(odcs_token) + # Inject the file to into the compose log dir + self.inject_builds_compose(compose_info) \ No newline at end of file