Skip to content

Commit b3c2161

Browse files
f-gallandAlexRuiz7
andcommitted
Add missing tools and files back into Wazuh Indexer packages (#117)
* add remove files function to assemble.sh * Remove unneeded files on assembled tar packages * Remove duplicated function Fix wrong variable assignment * Adding function to package Wazuh`s tools to assemble.sh * Make the files' versions follow the repo's VERSION file * Fix download of Wazuh tools for packages assembly --------- Signed-off-by: Álex Ruiz <[email protected]> Co-authored-by: Álex Ruiz <[email protected]>
1 parent ceebf3f commit b3c2161

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

scripts/assemble.sh

+18-3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,21 @@ function remove_unneeded_files() {
172172
rm "$PATH_PLUGINS/opensearch-security/tools/install_demo_configuration.sh"
173173
}
174174

175+
# ====
176+
# Add additional tools into packages
177+
# ====
178+
function add_wazuh_tools() {
179+
local version
180+
version=$(<VERSION)
181+
version=${version%%.[[:digit:]]}
182+
local download_url
183+
download_url="https://packages-dev.wazuh.com/${version}"
184+
185+
wget -q "${download_url}/config.yml" -O $PATH_PLUGINS/opensearch-security/tools/config.yml
186+
wget -q "${download_url}/wazuh-passwords-tool.sh "-O $PATH_PLUGINS/opensearch-security/tools/wazuh-passwords-tool.sh
187+
wget -q "${download_url}/wazuh-certs-tool.sh" -O $PATH_PLUGINS/opensearch-security/tools/wazuh-certs-tool.sh
188+
}
189+
175190
# ====
176191
# Copy performance analyzer service file
177192
# ====
@@ -231,6 +246,7 @@ function assemble_tar() {
231246
# Swap configuration files
232247
add_configuration_files
233248
remove_unneeded_files
249+
add_wazuh_tools
234250

235251
# Pack
236252
archive_name="wazuh-indexer-$(cat VERSION)"
@@ -267,14 +283,14 @@ function assemble_rpm() {
267283
# Swap configuration files
268284
add_configuration_files
269285
remove_unneeded_files
286+
add_wazuh_tools
270287

271288
# Generate final package
272289
local topdir
273290
local version
274291
local spec_file="wazuh-indexer.rpm.spec"
275292
topdir=$(pwd)
276293
version=$(cat ./usr/share/wazuh-indexer/VERSION)
277-
# TODO validate architecture
278294
rpmbuild --bb \
279295
--define "_topdir ${topdir}" \
280296
--define "_version ${version}" \
@@ -283,9 +299,7 @@ function assemble_rpm() {
283299

284300
# Move to the root folder, copy the package and clean.
285301
cd ../../..
286-
287302
package_name="wazuh-indexer-${version}-1.${SUFFIX}.${EXT}"
288-
289303
cp "${TMP_DIR}/RPMS/${SUFFIX}/${package_name}" "${OUTPUT}/dist/$ARTIFACT_PACKAGE_NAME"
290304

291305
clean
@@ -319,6 +333,7 @@ function assemble_deb() {
319333
# Swap configuration files
320334
add_configuration_files
321335
remove_unneeded_files
336+
add_wazuh_tools
322337

323338
# Generate final package
324339
local version

0 commit comments

Comments
 (0)