forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle_opensearch.py
24 lines (19 loc) · 891 Bytes
/
bundle_opensearch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import os
from assemble_workflow.bundle import Bundle
from manifests.build_manifest import BuildComponent
from system.os import current_platform
class BundleOpenSearch(Bundle):
@property
def install_plugin_script(self) -> str:
return "opensearch-plugin.bat" if current_platform() == "windows" else "opensearch-plugin"
def install_plugin(self, plugin: BuildComponent) -> None:
tmp_path = self._copy_component(plugin, "plugins")
cli_path = os.path.join(self.min_dist.archive_path, "bin", self.install_plugin_script)
self._execute(f"{cli_path} install --batch file:{tmp_path}")
super().install_plugin(plugin)