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

Fix tar error in build workflow #168

Merged
merged 12 commits into from
Apr 17, 2024
26 changes: 14 additions & 12 deletions dev-tools/build-packages/base/generate_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"}'
Expand Down
6 changes: 6 additions & 0 deletions dev-tools/build-packages/base/plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
alertingDashboards
customImportMapDashboards
ganttChartDashboards
indexManagementDashboards
notificationsDashboards
reportsDashboards
2 changes: 1 addition & 1 deletion dev-tools/build-packages/deb/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/build-packages/rpm/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading