def downloadReleaseBuilds(stageServer, productName, brandName, version, buildNumber, platform, candidatesDir=None, signed=False, usePymake=False): if candidatesDir is None: candidatesDir = makeCandidatesDir(productName, version, buildNumber, protocol='http', server=stageServer) files = makeReleaseRepackUrls(productName, brandName, version, platform, signed=signed) env = {} for fileName, remoteFile in files.iteritems(): url = '/'.join([p.strip('/') for p in [candidatesDir, urllib.quote(remoteFile)]]) log.info("Downloading %s to %s", url, fileName) urlretrieve(url, fileName) if fileName.endswith('exe'): if usePymake: env['WIN32_INSTALLER_IN'] = msys2windows(path.join(os.getcwd(), fileName)) else: env['WIN32_INSTALLER_IN'] = windows2msys(path.join(os.getcwd(), fileName)) else: if platform.startswith('win') and not usePymake: env['ZIP_IN'] = windows2msys(path.join(os.getcwd(), fileName)) else: env['ZIP_IN'] = msys2windows(path.join(os.getcwd(), fileName)) return env
def downloadReleaseBuilds(stageServer, productName, brandName, version, buildNumber, platform, candidatesDir=None, signed=False, usePymake=False): if candidatesDir is None: candidatesDir = makeCandidatesDir(productName, version, buildNumber, protocol='http', server=stageServer) files = makeReleaseRepackUrls(productName, brandName, version, platform, signed=signed) env = {} for fileName, remoteFile in files.iteritems(): url = '/'.join( [p.strip('/') for p in [candidatesDir, urllib.quote(remoteFile)]]) log.info("Downloading %s to %s", url, fileName) for _ in retrier(): with open(fileName, "wb") as f: try: r = requests.get(url, stream=True, timeout=15) r.raise_for_status() for chunk in r.iter_content(chunk_size=5 * 1024**2): f.write(chunk) r.close() break except (requests.HTTPError, requests.ConnectionError, requests.Timeout): log.exception("Caught exception downloading") if fileName.endswith('exe'): if usePymake: env['WIN32_INSTALLER_IN'] = msys2windows( path.join(os.getcwd(), fileName)) else: env['WIN32_INSTALLER_IN'] = windows2msys( path.join(os.getcwd(), fileName)) else: if platform.startswith('win') and not usePymake: env['ZIP_IN'] = windows2msys(path.join(os.getcwd(), fileName)) else: env['ZIP_IN'] = msys2windows(path.join(os.getcwd(), fileName)) return env
def downloadReleaseBuilds(stageServer, productName, brandName, version, buildNumber, platform, candidatesDir=None, signed=False, usePymake=False): if candidatesDir is None: candidatesDir = makeCandidatesDir(productName, version, buildNumber, protocol='http', server=stageServer) files = makeReleaseRepackUrls(productName, brandName, version, platform, signed=signed) env = {} for fileName, remoteFile in files.iteritems(): url = '/'.join([p.strip('/') for p in [candidatesDir, urllib.quote(remoteFile)]]) log.info("Downloading %s to %s", url, fileName) for _ in retrier(): with open(fileName, "wb") as f: try: r = requests.get(url, stream=True, timeout=15) r.raise_for_status() for chunk in r.iter_content(chunk_size=5*1024**2): f.write(chunk) r.close() break except (requests.HTTPError, requests.ConnectionError, requests.Timeout): log.exception("Caught exception downloading") if fileName.endswith('exe'): if usePymake: env['WIN32_INSTALLER_IN'] = msys2windows(path.join(os.getcwd(), fileName)) else: env['WIN32_INSTALLER_IN'] = windows2msys(path.join(os.getcwd(), fileName)) else: if platform.startswith('win') and not usePymake: env['ZIP_IN'] = windows2msys(path.join(os.getcwd(), fileName)) else: env['ZIP_IN'] = msys2windows(path.join(os.getcwd(), fileName)) return env
staging_server = FTP_SERVER_TEMPLATE % release_config['stagingServer'] aus_server_url = release_config['ausServerUrl'] build_number = release_config['buildNumber'] previous_releases_staging_server = FTP_SERVER_TEMPLATE % \ release_config.get('previousReleasesStagingServer', release_config['stagingServer']) # Current version data pc = PatcherConfig(open(options.config).read()) partials = pc['current-update']['partials'].keys() app_name = pc['appName'] to_version = pc['current-update']['to'] to_ = makeReleaseRepackUrls(product_name, app_name, to_version, options.platform, locale='%locale%', signed=True, exclude_secondary=True).values()[0] candidates_dir = makeCandidatesDir(product_name, to_version, build_number, ftp_root='/') to_path = "%s%s" % (candidates_dir, to_) uvc = UpdateVerifyConfig(product=app_name, channel=options.channel, aus_server=aus_server_url, to=to_path) # getUpdatePaths yields all of the update paths, but we need to know
update('buildbot-configs', revision=options.release_tag) release_config = validate(options) product_name = release_config['productName'] staging_server = FTP_SERVER_TEMPLATE % release_config['stagingServer'] aus_server_url = release_config['ausServerUrl'] build_number = release_config['buildNumber'] previous_releases_staging_server = FTP_SERVER_TEMPLATE % \ release_config.get('previousReleasesStagingServer', release_config['stagingServer']) # Current version data pc = PatcherConfig(open(options.config).read()) app_name = pc['appName'] to_version = pc['current-update']['to'] to_ = makeReleaseRepackUrls( product_name, app_name, to_version, options.platform, locale='%locale%', signed=True, exclude_secondary=True ).values()[0] candidates_dir = makeCandidatesDir( product_name, to_version, build_number, ftp_root='/') to_path = "%s%s" % (candidates_dir, to_) partials = pc['current-update']['partials'].keys() # Exclude current version from update verify completes = pc.getFromVersions() uvc = UpdateVerifyConfig(product=app_name, platform=update_platform, channel=options.channel, aus_server=aus_server_url, to=to_path) to_locales = pc['release'][to_version]['locales'] # remove exceptions for to build, e.g. "ja" for mac for locale, platforms in pc['release'][to_version]['exceptions'].iteritems():
release_config = validate(options) product_name = release_config["productName"] ftp_server = FTP_SERVER_TEMPLATE % release_config["ftpServer"] aus_server_url = release_config["ausServerUrl"] build_number = release_config["buildNumber"] previous_releases_ftp_server = FTP_SERVER_TEMPLATE % release_config.get( "previousReleasesStagingServer", release_config["ftpServer"] ) # Current version data pc = PatcherConfig(open(options.config).read()) partials = pc["current-update"]["partials"].keys() app_name = pc["appName"] to_version = pc["current-update"]["to"] to_ = makeReleaseRepackUrls( product_name, app_name, to_version, options.platform, locale="%locale%", signed=True, exclude_secondary=True ).values()[0] candidates_dir = makeCandidatesDir(product_name, to_version, build_number, ftp_root="/") to_path = "%s%s" % (candidates_dir, to_) uvc = UpdateVerifyConfig(product=app_name, channel=options.channel, aus_server=aus_server_url, to=to_path) # getUpdatePaths yields all of the update paths, but we need to know # everything about a fromVersion before we can add it to the update # verify config, so we need to collect everything it yields before # acting on it. updatePaths = {} for fromVersion, platform, locale, _, _ in pc.getUpdatePaths(): # Skip paths from platforms we don't care about. if platform != ftp_platform: continue