1010import { REPO_ROOT } from '@kbn/repo-info' ;
1111import { removePackagesFromPackageMap } from '@kbn/repo-packages' ;
1212import { KIBANA_SOLUTIONS } from '@kbn/projects-solutions-groups' ;
13- import type { KibanaSolution } from '@kbn/projects-solutions-groups' ;
1413import { resolve , join } from 'path' ;
1514import { scanCopy , deleteAll , copyAll } from '../lib' ;
16- import type { Task , Platform } from '../lib' ;
15+ import type { Task , Platform , Solution } from '../lib' ;
1716import { getNodeDownloadInfo } from './nodejs' ;
1817
1918export const CreateArchivesSources : Task = {
2019 description : 'Creating platform-specific archive source directories' ,
2120 async run ( config , log , build ) {
22- async function removeSolutions ( solutionsToRemove : KibanaSolution [ ] , platform : Platform ) {
21+ async function removeSolutions ( solutionsToRemove : Solution [ ] , platform : Platform ) {
2322 const solutionPluginNames : string [ ] = [ ] ;
2423
2524 for ( const solution of solutionsToRemove ) {
25+ if ( ! solution ) continue ;
2626 const solutionPlugins = config . getPrivateSolutionPackagesFromRepo ( solution ) ;
2727 solutionPluginNames . push ( ...solutionPlugins . map ( ( p ) => p . name ) ) ;
2828 }
@@ -81,7 +81,7 @@ export const CreateArchivesSources: Task = {
8181
8282 // Copy solution config.yml
8383 const WORKPLACE_AI_CONFIGS = [ 'serverless.workplaceai.yml' ] ;
84- const SEARCH_CONFIGS = [ 'serverless.es.yml' ] ;
84+ const ELASTICSEARCH_CONFIGS = [ 'serverless.es.yml' ] ;
8585 const OBSERVABILITY_CONFIGS = [
8686 'serverless.oblt.yml' ,
8787 'serverless.oblt.{logs_essentials,complete}.yml' ,
@@ -95,8 +95,8 @@ export const CreateArchivesSources: Task = {
9595 case 'workplaceai' :
9696 configFiles . push ( ...WORKPLACE_AI_CONFIGS ) ;
9797 break ;
98- case 'search ' :
99- configFiles . push ( ...SEARCH_CONFIGS ) ;
98+ case 'elasticsearch ' :
99+ configFiles . push ( ...ELASTICSEARCH_CONFIGS ) ;
100100 break ;
101101 case 'observability' :
102102 configFiles . push ( ...OBSERVABILITY_CONFIGS ) ;
@@ -107,7 +107,7 @@ export const CreateArchivesSources: Task = {
107107 default :
108108 configFiles . push (
109109 ...WORKPLACE_AI_CONFIGS ,
110- ...SEARCH_CONFIGS ,
110+ ...ELASTICSEARCH_CONFIGS ,
111111 ...OBSERVABILITY_CONFIGS ,
112112 ...SECURITY_CONFIGS
113113 ) ;
@@ -123,8 +123,11 @@ export const CreateArchivesSources: Task = {
123123
124124 // Remove non-target solutions
125125 const targetSolution = platform . getSolution ( ) ;
126- if ( targetSolution && KIBANA_SOLUTIONS . includes ( targetSolution ) ) {
127- const solutionsToRemove = KIBANA_SOLUTIONS . filter ( ( s ) => s !== targetSolution ) ;
126+ const ARTIFACT_SOLUTIONS = KIBANA_SOLUTIONS . map ( ( s ) =>
127+ s === 'search' ? 'elasticsearch' : s
128+ ) ;
129+ if ( targetSolution && ARTIFACT_SOLUTIONS . includes ( targetSolution ) ) {
130+ const solutionsToRemove = ARTIFACT_SOLUTIONS . filter ( ( s ) => s !== targetSolution ) ;
128131 await removeSolutions ( solutionsToRemove , platform ) ;
129132 }
130133 } else if ( config . isRelease ) {
0 commit comments