chore: move to GitHub hosting for Juggler binaries (#5293)
This commit is contained in:
parent
c7af7ded66
commit
3a49cfc9f8
@ -27,20 +27,20 @@ const ProxyAgent = require('https-proxy-agent');
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const getProxyForUrl = require('proxy-from-env').getProxyForUrl;
|
const getProxyForUrl = require('proxy-from-env').getProxyForUrl;
|
||||||
|
|
||||||
const DEFAULT_DOWNLOAD_HOST = 'https://storage.googleapis.com';
|
|
||||||
|
|
||||||
const downloadURLs = {
|
const downloadURLs = {
|
||||||
chromium: {
|
chromium: {
|
||||||
|
host: 'https://storage.googleapis.com',
|
||||||
linux: '%s/chromium-browser-snapshots/Linux_x64/%s/%s.zip',
|
linux: '%s/chromium-browser-snapshots/Linux_x64/%s/%s.zip',
|
||||||
mac: '%s/chromium-browser-snapshots/Mac/%s/%s.zip',
|
mac: '%s/chromium-browser-snapshots/Mac/%s/%s.zip',
|
||||||
win32: '%s/chromium-browser-snapshots/Win/%s/%s.zip',
|
win32: '%s/chromium-browser-snapshots/Win/%s/%s.zip',
|
||||||
win64: '%s/chromium-browser-snapshots/Win_x64/%s/%s.zip',
|
win64: '%s/chromium-browser-snapshots/Win_x64/%s/%s.zip',
|
||||||
},
|
},
|
||||||
firefox: {
|
firefox: {
|
||||||
linux: '%s/juggler-builds/%s/%s.zip',
|
host: 'https://github.com/puppeteer/juggler/releases',
|
||||||
mac: '%s/juggler-builds/%s/%s.zip',
|
linux: '%s/download/%s/%s.zip',
|
||||||
win32: '%s/juggler-builds/%s/%s.zip',
|
mac: '%s/download/%s/%s.zip',
|
||||||
win64: '%s/juggler-builds/%s/%s.zip',
|
win32: '%s/download/%s/%s.zip',
|
||||||
|
win64: '%s/download/%s/%s.zip',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -79,7 +79,8 @@ function archiveName(product, platform, revision) {
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
function downloadURL(product, platform, host, revision) {
|
function downloadURL(product, platform, host, revision) {
|
||||||
return util.format(downloadURLs[product][platform], host, revision, archiveName(product, platform, revision));
|
const url = util.format(downloadURLs[product][platform], host, revision, archiveName(product, platform, revision));
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
const readdirAsync = helper.promisify(fs.readdir.bind(fs));
|
const readdirAsync = helper.promisify(fs.readdir.bind(fs));
|
||||||
@ -103,7 +104,7 @@ class BrowserFetcher {
|
|||||||
this._product = (options.product || 'chromium').toLowerCase();
|
this._product = (options.product || 'chromium').toLowerCase();
|
||||||
assert(this._product === 'chromium' || this._product === 'firefox', `Unkown product: "${options.product}"`);
|
assert(this._product === 'chromium' || this._product === 'firefox', `Unkown product: "${options.product}"`);
|
||||||
this._downloadsFolder = options.path || path.join(projectRoot, '.local-browser');
|
this._downloadsFolder = options.path || path.join(projectRoot, '.local-browser');
|
||||||
this._downloadHost = options.host || DEFAULT_DOWNLOAD_HOST;
|
this._downloadHost = options.host || downloadURLs[this._product].host;
|
||||||
this._platform = options.platform || '';
|
this._platform = options.platform || '';
|
||||||
if (!this._platform) {
|
if (!this._platform) {
|
||||||
const platform = os.platform();
|
const platform = os.platform();
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"node": ">=8.9.4"
|
"node": ">=8.9.4"
|
||||||
},
|
},
|
||||||
"puppeteer": {
|
"puppeteer": {
|
||||||
"firefox_revision": "765beffcf39dc68cb2005b2b5343e283e26df7a3"
|
"firefox_revision": "v0.0.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"install": "node install.js",
|
"install": "node install.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user