def get_repo_config_from_environment():
    """Look for repository config in any defined environment variables. If
    found, import to main config."""
    import logging
    import os
    if 'GAD_REPO_URL' not in os.environ:
        return
    logger = logging.getLogger()
    repo_config = {'url': os.environ['GAD_REPO_URL']}
    logger.info(
        "Added configuration for '%s' found in environment variables" % os.
        environ['GAD_REPO_URL'])
    if 'GAD_REPO_BRANCH' in os.environ:
        repo_config['branch'] = os.environ['GAD_REPO_BRANCH']
    if 'GAD_REPO_REMOTE' in os.environ:
        repo_config['remote'] = os.environ['GAD_REPO_REMOTE']
    if 'GAD_REPO_PATH' in os.environ:
        repo_config['path'] = os.environ['GAD_REPO_PATH']
    if 'GAD_REPO_DEPLOY' in os.environ:
        repo_config['deploy'] = os.environ['GAD_REPO_DEPLOY']
    return repo_config
