示例#1
0
def main():
    config = Config()
    projects = config.get_projects()
    datafile = os.path.join(config.DATA_DIR, 'third-party-ci.log')
    db.create_projects()
    data = get_data(datafile, projects)
    load_data(data)
示例#2
0
def main():
    config = Config()
    db.create_projects()  # This will make sure the database has projects in it
    gerrit = Gerrit(
        hostname=config.cfg.AccountInfo.gerrit_host,
        username=config.cfg.AccountInfo.gerrit_username,
        port=int(config.cfg.AccountInfo.gerrit_port),
        keyfile=config.cfg.AccountInfo.gerrit_ssh_key
    )
    gerrit.startWatching()
    while True:
        event = gerrit.getEvent()[1]
        parsed_event = parse_event(event, config.get_projects())
        if parsed_event is not None:
            _store_event(parsed_event, config.DATA_DIR)