From 281eafb84649fde9efc6fe2cf96a2c2b6b86554c Mon Sep 17 00:00:00 2001 From: Fede Tux Date: Wed, 10 Jan 2024 13:56:34 -0300 Subject: [PATCH] add remove files function to assemble.sh --- scripts/assemble.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/assemble.sh b/scripts/assemble.sh index 67c8842f85226..7ec5c34b1deaa 100755 --- a/scripts/assemble.sh +++ b/scripts/assemble.sh @@ -165,6 +165,30 @@ function add_configuration_files() { find . -name "*.bat" -exec rm -rf {} \; } +# ==== +# Remove unneeded files +# ==== +function remove_unneeded_files() { + rm $PATH_PLUGINS/opensearch-security/tools/install_demo_configuration.sh +} + +# ==== +# Set up configuration files +# ==== +function add_configuration_files() { + # swap configuration files + cp $PATH_CONF/security/* $PATH_CONF/opensearch-security/ + cp $PATH_CONF/jvm.prod.options $PATH_CONF/jvm.options + cp $PATH_CONF/opensearch.prod.yml $PATH_CONF/opensearch.yml + + rm -r $PATH_CONF/security + rm $PATH_CONF/jvm.prod.options $PATH_CONF/opensearch.prod.yml + + # Remove symbolic links and bat files + find . -type l -exec rm -rf {} \; + find . -name "*.bat" -exec rm -rf {} \; +} + # ==== # Copy performance analyzer service file # ==== @@ -246,6 +270,7 @@ function assemble_rpm() { local src_path="./usr/share/wazuh-indexer" PATH_CONF="./etc/wazuh-indexer" PATH_BIN="${src_path}/bin" + PATH_PLUGINS="${src_path}/plugins" # Extract min-package. Creates usr/, etc/ and var/ in the current directory echo "Extract ${ARTIFACT_BUILD_NAME} archive" @@ -257,6 +282,8 @@ function assemble_rpm() { # Swap configuration files add_configuration_files + remove_unneeded_files + # Generate final package local topdir local version @@ -295,6 +322,7 @@ function assemble_deb() { local src_path="./usr/share/wazuh-indexer" PATH_CONF="./etc/wazuh-indexer" PATH_BIN="${src_path}/bin" + PATH_PLUGINS="${src_path}/plugins" # Extract min-package. Creates usr/, etc/ and var/ in the current directory echo "Extract ${ARTIFACT_BUILD_NAME} archive" @@ -307,6 +335,8 @@ function assemble_deb() { # Swap configuration files add_configuration_files + remove_unneeded_files + # Generate final package local version version=$(cat ./usr/share/wazuh-indexer/VERSION)