Beispiel #1
0
def write_and_commit(data,
                     data_path,
                     wiki_path,
                     commit_msg,
                     logger,
                     config,
                     wiki_template=None):
    corsica_path = os.path.join(config["releasewarrior_data_repo"],
                                config["corsica"])
    wiki = generate_wiki(data, wiki_template, logger, config)
    new_readme = update_markdown_index(logger, config)
    paths = []

    paths.append(write_data(data_path, data, logger, config))
    paths.append(write_wiki(wiki_path, wiki, logger, config))
    paths.append(
        write_wiki(
            os.path.join(config['releasewarrior_data_repo'], 'README.md'),
            new_readme, logger, config))
    if config['corsica_enabled']:
        corsica = generate_corsica(config, logger)
        paths.append(write_corsica(corsica_path, corsica, logger, config))
    for p in paths:
        logger.debug(p)
    if not os.environ.get("RW_DEV"):
        commit(paths, commit_msg, logger, config)
        if config.get("auto_push_data"):
            push(logger, config)
Beispiel #2
0
def data(push, pull, logger=LOGGER, config=CONFIG):
    """Interacts with the data repo."""
    if push and pull:
        logger.error("Can't push and pull at the same time.")
        sys.exit(1)
    if push:
        git.push(logger, config)
    if pull:
        git.pull(logger, config)
Beispiel #3
0
def data(push, logger=LOGGER, config=CONFIG):
    """Pushes teh data repo to upstream."""
    if push:
        git.push(logger, config)
Beispiel #4
0
def data(push, logger=LOGGER, config=CONFIG):
    if push:
        git.push(logger, config)