Example #1
0
 def get_build(self):
     build_data = self.get_message('builds.queue')
     if build_data is not None:
         build = Build(build_data)
         build.user = User.fetch(build_data['username'], sub_objects=False)
         if build.user is None:
             return None
         build.project = Project.fetch(build.user.username,
                                       build_data['project_name'],
                                       sub_objects=False)
         return build
Example #2
0
 def get_build(self):
     build_data = self.get_message('builds.queue')
     if build_data is not None:
         build = Build(build_data)
         build.user = User.fetch(build_data['username'], sub_objects=False)
         if build.user is None:
             return None
         build.project = Project.fetch(build.user.username,
                                       build_data['project_name'],
                                       sub_objects=False)
         return build
Example #3
0
    def run(self):
        self.must_run = True
        logging.debug("Starting Manager")

        while self.must_run:
            time.sleep(0.1)
            new_build = self.carrier.get_message('builds.queue')
            build = None
            if new_build is not None:
                build = Build(new_build)
                if build:
                    build.user = User.fetch(new_build['username'],
                                            sub_objects=False)
                    build.project = Project.fetch(build.username,
                                                  new_build['project_name'],
                                                  sub_objects=False)
                    logging.debug("Task received")
                    build.set_status("dispatching")
                    dispatcher = Dispatcher(build)
                    self.build_list[dispatcher.uuid2] = dispatcher
                    dispatcher.start()

            self.check_builds_status()