Skip to content

Commit

Permalink
Fix tar error in build workflow (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti authored Apr 17, 2024
1 parent aa2d0db commit 477276f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
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

0 comments on commit 477276f

Please sign in to comment.