Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing tools and files back into Wazuh Indexer packages #117

Merged
merged 7 commits into from
Jan 12, 2024
21 changes: 18 additions & 3 deletions scripts/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,21 @@ function remove_unneeded_files() {
rm "$PATH_PLUGINS/opensearch-security/tools/install_demo_configuration.sh"
}

# ====
# Add additional tools into packages
# ====
function add_wazuh_tools() {
local version
version=$(<VERSION)
version=${version%%.[[:digit:]]}
local download_url
download_url="https://packages-dev.wazuh.com/${version}"

wget -q "${download_url}/config.yml" -O $PATH_PLUGINS/opensearch-security/tools/config.yml
wget -q "${download_url}/wazuh-passwords-tool.sh "-O $PATH_PLUGINS/opensearch-security/tools/wazuh-passwords-tool.sh
wget -q "${download_url}/wazuh-certs-tool.sh" -O $PATH_PLUGINS/opensearch-security/tools/wazuh-certs-tool.sh
}

# ====
# Copy performance analyzer service file
# ====
Expand Down Expand Up @@ -231,6 +246,7 @@ function assemble_tar() {
# Swap configuration files
add_configuration_files
remove_unneeded_files
add_wazuh_tools

# Pack
archive_name="wazuh-indexer-$(cat VERSION)"
Expand Down Expand Up @@ -267,14 +283,14 @@ function assemble_rpm() {
# Swap configuration files
add_configuration_files
remove_unneeded_files
add_wazuh_tools

# Generate final package
local topdir
local version
local spec_file="wazuh-indexer.rpm.spec"
topdir=$(pwd)
version=$(cat ./usr/share/wazuh-indexer/VERSION)
# TODO validate architecture
rpmbuild --bb \
--define "_topdir ${topdir}" \
--define "_version ${version}" \
Expand All @@ -283,9 +299,7 @@ function assemble_rpm() {

# Move to the root folder, copy the package and clean.
cd ../../..

package_name="wazuh-indexer-${version}-1.${SUFFIX}.${EXT}"

cp "${TMP_DIR}/RPMS/${SUFFIX}/${package_name}" "${OUTPUT}/dist/$ARTIFACT_PACKAGE_NAME"

clean
Expand Down Expand Up @@ -319,6 +333,7 @@ function assemble_deb() {
# Swap configuration files
add_configuration_files
remove_unneeded_files
add_wazuh_tools

# Generate final package
local version
Expand Down