Skip to content

Commit 52af5b7

Browse files
author
Tyler Smalley
authored
Restores task for downloading Chromium builds (#71749) (#71926)
This was removed in #69165 without realizing it was used by the packer cache. I renamed it to be more inline with what it actually does. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> # Conflicts: # .ci/packer_cache_for_branch.sh
1 parent 585c367 commit 52af5b7

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

x-pack/gulpfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ require('../src/setup_node_env');
99
const { buildTask } = require('./tasks/build');
1010
const { devTask } = require('./tasks/dev');
1111
const { testTask, testKarmaTask, testKarmaDebugTask } = require('./tasks/test');
12+
const { downloadChromium } = require('./tasks/download_chromium');
1213

1314
// export the tasks that are runnable from the CLI
1415
module.exports = {
1516
build: buildTask,
1617
dev: devTask,
18+
downloadChromium,
1719
test: testTask,
1820
'test:karma': testKarmaTask,
1921
'test:karma:debug': testKarmaDebugTask,

x-pack/tasks/download_chromium.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
import { LevelLogger } from '../plugins/reporting/server/lib';
8+
import { ensureBrowserDownloaded } from '../plugins/reporting/server/browsers/download';
9+
10+
export const downloadChromium = async () => {
11+
// eslint-disable-next-line no-console
12+
const consoleLogger = (tag: string) => (message: unknown) => console.log(tag, message);
13+
const innerLogger = {
14+
get: () => innerLogger,
15+
debug: consoleLogger('debug'),
16+
info: consoleLogger('info'),
17+
warn: consoleLogger('warn'),
18+
trace: consoleLogger('trace'),
19+
error: consoleLogger('error'),
20+
fatal: consoleLogger('fatal'),
21+
log: consoleLogger('log'),
22+
};
23+
24+
const levelLogger = new LevelLogger(innerLogger);
25+
await ensureBrowserDownloaded(levelLogger);
26+
};

0 commit comments

Comments
 (0)