Example #1
0
    def run(self):

        for serv in self.service_list:
            if serv == "cluster-configuration":
                continue
            if file_handler.file_exist_or_not("src/{0}/deploy/service.yaml".format(serv)) == False:
                self.logger.warning("service.yaml can't be found on the directory of {0}".format(serv))
                self.logger.warning("Please check your source code. The {0}'s service will be skipped.".format(serv))
                continue
            self.start(serv)

        if "cluster-configuration" in self.service_list:
            self.start(serv)
    def get_service_list(self):

        service_list = list()

        subdir_list = directory_handler.get_subdirectory_list("src/")
        for subdir in subdir_list:

            service_deploy_dir = "src/{0}/deploy".format(subdir)
            service_deploy_conf_path =  "src/{0}/deploy/service.yaml".format(subdir)
            if file_handler.directory_exits(service_deploy_dir) and file_handler.file_exist_or_not(service_deploy_conf_path):
                service_list.append(subdir)

        self.logger.info("Get the service-list to manage : {0}".format(str(service_list)))

        return service_list