Skip to content

Commit bef8684

Browse files
kibanamachinejbudz
andauthored
[build] Include x-pack example plugins when using example-plugins flag (#126931) (#127641)
* Revert "Revert "[build] Include x-pack example plugins when using example-plugins flag (#120697)" (#125729)" This reverts commit 7b4c34e. * skip alerting_example * link to issue (cherry picked from commit 53d7456) Co-authored-by: Jonathan Budzenski <jon@elastic.co>
1 parent f32323b commit bef8684

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

src/dev/build/tasks/build_kibana_example_plugins.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,26 @@ import { exec, mkdirp, copyAll, Task } from '../lib';
1313

1414
export const BuildKibanaExamplePlugins: Task = {
1515
description: 'Building distributable versions of Kibana example plugins',
16-
async run(config, log, build) {
17-
const examplesDir = Path.resolve(REPO_ROOT, 'examples');
16+
async run(config, log) {
1817
const args = [
19-
'../../scripts/plugin_helpers',
18+
Path.resolve(REPO_ROOT, 'scripts/plugin_helpers'),
2019
'build',
2120
`--kibana-version=${config.getBuildVersion()}`,
2221
];
2322

24-
const folders = Fs.readdirSync(examplesDir, { withFileTypes: true })
25-
.filter((f) => f.isDirectory())
26-
.map((f) => Path.resolve(REPO_ROOT, 'examples', f.name));
23+
const getExampleFolders = (dir: string) => {
24+
return Fs.readdirSync(dir, { withFileTypes: true })
25+
.filter((f) => f.isDirectory())
26+
.map((f) => Path.resolve(dir, f.name));
27+
};
28+
29+
// https://github.com/elastic/kibana/issues/127338
30+
const skipExamples = ['alerting_example'];
31+
32+
const folders = [
33+
...getExampleFolders(Path.resolve(REPO_ROOT, 'examples')),
34+
...getExampleFolders(Path.resolve(REPO_ROOT, 'x-pack/examples')),
35+
].filter((p) => !skipExamples.includes(Path.basename(p)));
2736

2837
for (const examplePlugin of folders) {
2938
try {
@@ -40,8 +49,8 @@ export const BuildKibanaExamplePlugins: Task = {
4049

4150
const pluginsDir = config.resolveFromTarget('example_plugins');
4251
await mkdirp(pluginsDir);
43-
await copyAll(examplesDir, pluginsDir, {
44-
select: ['*/build/*.zip'],
52+
await copyAll(REPO_ROOT, pluginsDir, {
53+
select: ['examples/*/build/*.zip', 'x-pack/examples/*/build/*.zip'],
4554
});
4655
},
4756
};

0 commit comments

Comments
 (0)