diff --git a/dev-tools/build-packages/base/generate_base.sh b/dev-tools/build-packages/base/generate_base.sh index 1580cf4d1d17..20f1385638c3 100755 --- a/dev-tools/build-packages/base/generate_base.sh +++ b/dev-tools/build-packages/base/generate_base.sh @@ -118,7 +118,7 @@ build() { fi tar -zxf wazuh-dashboard.tar.gz - directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u) + directory_name=$(ls -t | head -1) working_dir="wazuh-dashboard-$version-$revision-linux-x64" mv $directory_name $working_dir cd $working_dir @@ -127,23 +127,25 @@ build() { echo Building the package... echo - # Install plugins - bin/opensearch-dashboards-plugin install alertingDashboards - bin/opensearch-dashboards-plugin install customImportMapDashboards - bin/opensearch-dashboards-plugin install ganttChartDashboards - bin/opensearch-dashboards-plugin install indexManagementDashboards - bin/opensearch-dashboards-plugin install notificationsDashboards - bin/opensearch-dashboards-plugin install reportsDashboards # Install Wazuh apps and Security app - plugins=$(ls $tmp_dir/applications) - echo $plugins + + plugins=$(ls $tmp_dir/applications)' '$(cat ../../plugins) for plugin in $plugins; do - echo $plugin if [[ $plugin =~ .*\.zip ]]; then - bin/opensearch-dashboards-plugin install file:../applications/$plugin + install='file:../applications/'$plugin + else + install=$plugin + fi + echo "Installing ${plugin%.*} plugin" + if ! bin/opensearch-dashboards-plugin install $install 2>&1 > /dev/null; then + echo "Plugin installation failed" + clean 1 fi done + echo + echo Finished installing plugins + echo # Move installed plugins from categories after generating the package category_explore='{id:"explore",label:"Explore",order:100,euiIconType:"search"}' diff --git a/dev-tools/build-packages/base/plugins b/dev-tools/build-packages/base/plugins new file mode 100644 index 000000000000..6a31dc91f76b --- /dev/null +++ b/dev-tools/build-packages/base/plugins @@ -0,0 +1,6 @@ +alertingDashboards +customImportMapDashboards +ganttChartDashboards +indexManagementDashboards +notificationsDashboards +reportsDashboards diff --git a/dev-tools/build-packages/deb/launcher.sh b/dev-tools/build-packages/deb/launcher.sh index 1ccc701f4f96..2eb463d1139e 100755 --- a/dev-tools/build-packages/deb/launcher.sh +++ b/dev-tools/build-packages/deb/launcher.sh @@ -81,8 +81,8 @@ build_deb() { echo # Prepare the package - directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u) tar -zxf wazuh-dashboard.tar.gz + directory_name=$(ls -t | head -1) rm wazuh-dashboard.tar.gz mv $directory_name wazuh-dashboard-base jq '.wazuh.revision="'${revision}'"' wazuh-dashboard-base/package.json > pkgtmp.json && mv pkgtmp.json wazuh-dashboard-base/package.json diff --git a/dev-tools/build-packages/rpm/launcher.sh b/dev-tools/build-packages/rpm/launcher.sh index cc2996240461..0cd7fb16559e 100755 --- a/dev-tools/build-packages/rpm/launcher.sh +++ b/dev-tools/build-packages/rpm/launcher.sh @@ -82,8 +82,8 @@ build_rpm() { echo # Prepare the package - directory_name=$(tar tf wazuh-dashboard.tar.gz | head -1 | sed 's#/.*##' | sort -u) tar -zxf wazuh-dashboard.tar.gz + directory_name=$(ls -t | head -1) rm wazuh-dashboard.tar.gz mv $directory_name wazuh-dashboard-base jq '.wazuh.revision="'${revision}'"' wazuh-dashboard-base/package.json > pkgtmp.json && mv pkgtmp.json wazuh-dashboard-base/package.json