diff --git a/manifests/2.4.0/opensearch-2.4.0.yml b/manifests/2.4.0/opensearch-2.4.0.yml index 07135a90b2..ce7dd8ff4a 100644 --- a/manifests/2.4.0/opensearch-2.4.0.yml +++ b/manifests/2.4.0/opensearch-2.4.0.yml @@ -89,6 +89,7 @@ components: ref: '2.x' platforms: - linux + - windows checks: - gradle:properties:version - gradle:dependencies:opensearch.version @@ -97,6 +98,7 @@ components: ref: '2.x' platforms: - linux + - windows checks: - gradle:properties:version - gradle:dependencies:opensearch.version diff --git a/scripts/components/OpenSearch-Dashboards/build.sh b/scripts/components/OpenSearch-Dashboards/build.sh index 3cf32e108b..b010b1a1e8 100755 --- a/scripts/components/OpenSearch-Dashboards/build.sh +++ b/scripts/components/OpenSearch-Dashboards/build.sh @@ -116,15 +116,11 @@ case $PLATFORM-$DISTRIBUTION-$ARCHITECTURE in ;; esac -echo "Setting node version" - -if [ "$PLATFORM" != "windows" ]; then - source $NVM_DIR/nvm.sh - nvm use -else - volta install node@`cat .nvmrc` - volta install yarn +NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" +if [ "$PLATFORM" = "windows" ]; then + NVM_CMD="volta install node@`cat .nvmrc` && volta install yarn" fi +eval $NVM_CMD echo "Building node modules for core with $PLATFORM-$DISTRIBUTION-$ARCHITECTURE" yarn osd bootstrap diff --git a/scripts/components/reportsDashboards/build.sh b/scripts/components/reportsDashboards/build.sh index ed6044a938..f25ee7c6a8 100755 --- a/scripts/components/reportsDashboards/build.sh +++ b/scripts/components/reportsDashboards/build.sh @@ -73,6 +73,9 @@ case $PLATFORM in linux*) PLATFORM="linux" ;; + windows*|*nt*) + PLATFORM="windows" + ;; *) echo "Unsupported platform: $PLATFORM" exit 1 @@ -89,6 +92,11 @@ case $ARCHITECTURE in ;; esac +NVM_CMD="source $NVM_DIR/nvm.sh && nvm use" +if [ "$PLATFORM" = "windows" ]; then + NVM_CMD="volta install node@`cat ../../OpenSearch-Dashboards/.nvmrc` && volta install yarn" +fi + CHROMIUM_URL="https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/$CHROMIUM_TARGET" MINOR_VERSION=${VERSION%.*} @@ -103,9 +111,9 @@ PLUGIN_NAME=$(basename $(dirname "$PWD")) # This makes it so there is a dependency on having Dashboards pulled already. cp -r ../$PLUGIN_FOLDER/ ../../OpenSearch-Dashboards/plugins echo "BUILD MODULES FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && source $NVM_DIR/nvm.sh && nvm use && yarn osd bootstrap) +(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && yarn osd bootstrap) echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME" -(cd ../../OpenSearch-Dashboards && source $NVM_DIR/nvm.sh && nvm use && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) +(cd ../../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_FOLDER && yarn plugin_helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER) ZIP_NAME=`ls ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build | grep .zip` unzip ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/$ZIP_NAME -d ../../OpenSearch-Dashboards/plugins/$PLUGIN_FOLDER/build/ # Reporting uses headless chromium to generate reports, which needs to be included in its artifact