mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[build] Include x-pack example plugins when using example-plugins flag (#120697)
* [build] Include x-pack example plugins when using example-plugins flag * revert test
This commit is contained in:
parent
e4c20a42b6
commit
3a4c6030b9
1 changed files with 14 additions and 8 deletions
|
@ -13,17 +13,23 @@ import { exec, mkdirp, copyAll, Task } from '../lib';
|
|||
|
||||
export const BuildKibanaExamplePlugins: Task = {
|
||||
description: 'Building distributable versions of Kibana example plugins',
|
||||
async run(config, log, build) {
|
||||
const examplesDir = Path.resolve(REPO_ROOT, 'examples');
|
||||
async run(config, log) {
|
||||
const args = [
|
||||
'../../scripts/plugin_helpers',
|
||||
Path.resolve(REPO_ROOT, 'scripts/plugin_helpers'),
|
||||
'build',
|
||||
`--kibana-version=${config.getBuildVersion()}`,
|
||||
];
|
||||
|
||||
const folders = Fs.readdirSync(examplesDir, { withFileTypes: true })
|
||||
.filter((f) => f.isDirectory())
|
||||
.map((f) => Path.resolve(REPO_ROOT, 'examples', f.name));
|
||||
const getExampleFolders = (dir: string) => {
|
||||
return Fs.readdirSync(dir, { withFileTypes: true })
|
||||
.filter((f) => f.isDirectory())
|
||||
.map((f) => Path.resolve(dir, f.name));
|
||||
};
|
||||
|
||||
const folders = [
|
||||
...getExampleFolders(Path.resolve(REPO_ROOT, 'examples')),
|
||||
...getExampleFolders(Path.resolve(REPO_ROOT, 'x-pack/examples')),
|
||||
];
|
||||
|
||||
for (const examplePlugin of folders) {
|
||||
try {
|
||||
|
@ -40,8 +46,8 @@ export const BuildKibanaExamplePlugins: Task = {
|
|||
|
||||
const pluginsDir = config.resolveFromTarget('example_plugins');
|
||||
await mkdirp(pluginsDir);
|
||||
await copyAll(examplesDir, pluginsDir, {
|
||||
select: ['*/build/*.zip'],
|
||||
await copyAll(REPO_ROOT, pluginsDir, {
|
||||
select: ['examples/*/build/*.zip', 'x-pack/examples/*/build/*.zip'],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue