Skip to content

Commit

Permalink
add remove files function to assemble.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
f-galland committed Jan 10, 2024
1 parent e60d911 commit 281eafb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ====
Expand Down Expand Up @@ -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"
Expand All @@ -257,6 +282,8 @@ function assemble_rpm() {
# Swap configuration files
add_configuration_files

remove_unneeded_files

# Generate final package
local topdir
local version
Expand Down Expand Up @@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit 281eafb

Please sign in to comment.