diff options
Diffstat (limited to 'rpmci/rpmci_binrpm_builder_main.py')
-rw-r--r-- | rpmci/rpmci_binrpm_builder_main.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rpmci/rpmci_binrpm_builder_main.py b/rpmci/rpmci_binrpm_builder_main.py index 3854434..d62eafb 100644 --- a/rpmci/rpmci_binrpm_builder_main.py +++ b/rpmci/rpmci_binrpm_builder_main.py @@ -36,6 +36,9 @@ class BinRPMBuilder(object): srpm_msgqueue_dir = config.get('SRPM', 'msgqueue') self._srpm_msgqueue = msgqueue.MessageQueue(srpm_msgqueue_dir) + build_msgqueue_dir = config.get('build', 'msgqueue') + self._build_msgqueue = msgqueue.MessageQueue(build_msgqueue_dir) + self._artifactset = artifact.ArtifactSet.from_config(config) self._artifact_to_repo = {} artifact_basedir = config.get('build', 'artifactdir') @@ -48,9 +51,11 @@ class BinRPMBuilder(object): def start(self): latest = self._srcrepo.get_latest_version() + logging.info("Doing an initial build now") if latest is not None: self._rebuild_to_repoversion(latest.version) self._srpm_msgqueue.connect(self._on_srpm_message) + self._build_msgqueue.connect(self._on_build_message) def _target_for_srpm(self, srpm_name): (name, ver, rest) = srpm_name.rsplit('-', 2) @@ -80,6 +85,18 @@ class BinRPMBuilder(object): arch = architecture return '%s-%s' % (mock_os, arch) + def _on_build_message(self, q, messages): + rebuild_all = False + for msg in messages: + if 'rebuild' in msg.payload: + logging.info("Processing rebuild all message") + rebuild_all = True + q.consume(msg) + + if rebuild_all: + latest_repo = self._srcrepo.get_latest_version() + self._rebuild_to_repoversion(latest_repo.version) + def _on_srpm_message(self, q, messages): msg_list = list(messages) num_msgs = len(msg_list) @@ -99,6 +116,7 @@ class BinRPMBuilder(object): exec_basedir = os.path.dirname(sys.argv[0]) for artifact in self._artifactset.artifacts: + logging.info("Preparing rebuild of artifact %r" % (artifact.name, )) artifact_srpms = set() failed = False for target in artifact.targets: |