Skip to content

Commit

Permalink
Fix tar packages plugin bundling (#466)
Browse files Browse the repository at this point in the history
* Removing extra unneeded directory change command

* Change directory to repo root

* Making assemble.sh look for plugins in the artifacts folder

* Putting the uncompressed directory into a variable

* Fix assembled tar compression directory

* Remove pwd

---------

Co-authored-by: Álex Ruiz <[email protected]>
  • Loading branch information
f-galland and AlexRuiz7 committed Oct 22, 2024
1 parent fc22c80 commit 7420623
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions build-scripts/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,29 +264,30 @@ function clean() {
# ====
function assemble_tar() {
cd "${TMP_DIR}"
PATH_CONF="./config"
PATH_BIN="./bin"
PATH_PLUGINS="./plugins"

# Extract
echo "Extract ${ARTIFACT_BUILD_NAME} archive"
tar -zvxf "${ARTIFACT_BUILD_NAME}"
cd "$(ls -d wazuh-indexer-*/)"
local decompressed_tar_dir
decompressed_tar_dir=$(ls -d wazuh-indexer-*/)

local version
version=$(cat VERSION)
version=$(cat "${decompressed_tar_dir}"/VERSION)

PATH_CONF="${decompressed_tar_dir}/config"
PATH_BIN="${decompressed_tar_dir}/bin"
PATH_PLUGINS="${decompressed_tar_dir}/plugins"

# Install plugins
install_plugins "${version}"
fix_log_rotation ${PATH_CONF}
fix_log_rotation "${PATH_CONF}"
# Swap configuration files
add_configuration_files
remove_unneeded_files
add_wazuh_tools "${version}"

# Pack
archive_name="wazuh-indexer-${version}"
cd ..
tar -cvf "${archive_name}-${SUFFIX}.${EXT}" "${archive_name}"
cd ../../..
cp "${TMP_DIR}/${archive_name}-${SUFFIX}.${EXT}" "${OUTPUT}/dist/$ARTIFACT_PACKAGE_NAME"
Expand Down

0 comments on commit 7420623

Please sign in to comment.