Skip to content

Commit

Permalink
Add error control to plugin installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Apr 17, 2024
1 parent 7ae6c74 commit dfb5f74
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
23 changes: 12 additions & 11 deletions dev-tools/build-packages/base/generate_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,24 @@ 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
if bin/opensearch-dashboards-plugin install $install | tee /dev/tty | grep -iE 'unsuccessful|error|fail' > /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

0 comments on commit dfb5f74

Please sign in to comment.