示例#1
0
    def __init__(self, config=None):
        self.log = Log()
        self.currentRevision = None
        root = None

        if config:
            if os.path.isdir(config):
                root = config
            else:
                raise Exception(config + ' is not a directory or dont exists!')
        else:
            root = None

        try:
            self.git = Git(root)
            self.root = self.git.root
            try:
                self.parse_config()
                for target in self.config['targets']:
                    if target['enabled'] == True:
                        self.deploy(target)
            except Exception as e:
                raise e
        except Exception as e:
            raise e
示例#2
0
 def sync(self, tmp, branch, ssh_path):
     git = Git(tmp)
     git.update(branch, ssh_path)