Ejemplo n.º 1
0
    def __init__(self, download_options, install_dir="", link_dir="", mv_platform=None,
                 edition=None, architecture=None, use_latest=None, versions=None,
                 evergreen_config=None, github_oauth_token=None, debug=None,
                 ignore_failed_push=False):
        """Initialize."""
        setup_logging(debug)
        self.install_dir = os.path.abspath(install_dir)
        self.link_dir = os.path.abspath(link_dir)

        self.edition = edition.lower() if edition else None
        self.platform = mv_platform.lower() if mv_platform else None
        self.architecture = architecture.lower() if architecture else None
        self.use_latest = use_latest
        self.versions = versions
        self.ignore_failed_push = ignore_failed_push

        self.download_binaries = download_options.download_binaries
        self.download_symbols = download_options.download_symbols
        self.download_artifacts = download_options.download_artifacts
        self.download_python_venv = download_options.download_python_venv

        self.evg_api = evergreen_conn.get_evergreen_api(evergreen_config)
        # In evergreen github oauth token is stored as `token ******`, so we remove the leading part
        self.github_oauth_token = github_oauth_token.replace("token ",
                                                             "") if github_oauth_token else None
        with open(config.SETUP_MULTIVERSION_CONFIG) as file_handle:
            raw_yaml = yaml.safe_load(file_handle)
        self.config = config.SetupMultiversionConfig(raw_yaml)

        self._is_windows = is_windows()
        self._windows_bin_install_dirs = []
Ejemplo n.º 2
0
    def __init__(self, options):
        """Initialize."""
        setup_logging(options.debug)
        cwd = os.getcwd()
        self.install_dir = os.path.join(cwd, options.install_dir)
        self.link_dir = os.path.join(cwd, options.link_dir)

        self.edition = options.edition.lower() if options.edition else None
        self.platform = options.platform.lower() if options.platform else None
        self.architecture = options.architecture.lower(
        ) if options.architecture else None
        self.use_latest = options.use_latest
        self.versions = options.versions

        self.download_binaries = options.download_binaries
        self.download_symbols = options.download_symbols
        self.download_artifacts = options.download_artifacts

        self.evg_api = evergreen_conn.get_evergreen_api(
            options.evergreen_config)
        # In evergreen github oauth token is stored as `token ******`, so we remove the leading part
        self.github_oauth_token = options.github_oauth_token.replace(
            "token ", "") if options.github_oauth_token else None
        with open(config.SETUP_MULTIVERSION_CONFIG) as file_handle:
            raw_yaml = yaml.safe_load(file_handle)
        self.config = config.SetupMultiversionConfig(raw_yaml)