Пример #1
0
def index(config, verbose, tree_names):
    """Build indices for one or more trees.

    When finished, update elasticsearch aliases and the catalog index to make
    the new indices available to the DXR server process.

    Each of TREES is an INI section title from the config file, specifying a
    source tree to build. If none are specified, we build all trees, in the
    order they occur in the file.

    """
    for tree in tree_objects(tree_names, config):
        index_and_deploy_tree(tree, verbose=verbose)
Пример #2
0
def index(config, verbose, tree_names):
    """Build indices for one or more trees.

    When finished, update elasticsearch aliases and the catalog index to make
    the new indices available to the DXR server process.

    Each of TREES is an INI section title from the config file, specifying a
    source tree to build. If none are specified, we build all trees, in the
    order they occur in the file.

    """
    for tree in tree_objects(tree_names, config):
        index_and_deploy_tree(tree, verbose=verbose)
Пример #3
0
def clean(config, tree_names):
    """Remove logs, temp files, and build artifacts.

    Remove the filesystem debris left after indexing one or more TREES, leaving
    the index itself intact. Delete log files and, if present, temp files. Run
    `make clean` (or other clean_command from the config file) on trees.

    """
    for tree in tree_objects(tree_names, config):
        rmtree_if_exists(tree.log_folder)
        rmtree_if_exists(tree.temp_folder)
        chdir(tree.object_folder)
        if tree.clean_command:
            try:
                run(tree.clean_command)
            except CommandFailure as exc:
                raise ClickException(
                    'Running clean_command failed for "%s" tree: %s.' %
                    (tree.name, str(exc)))