From b7bf4a2d74ef9a7f454330ab8bab5b220b1aae11 Mon Sep 17 00:00:00 2001 From: Stephen Crawford <65832608+scrawfor99@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:26:08 -0500 Subject: [PATCH] Backport Install Workflow and Action (#2312) Signed-off-by: Stephen Crawford Signed-off-by: Stephen Crawford <65832608+scrawfor99@users.noreply.github.com> --- .../start-opensearch-with-one-plugin/action.yml | 11 +++++------ .github/workflows/plugin_install.yml | 5 ++--- tools/install_demo_configuration.bat | 5 +++++ tools/install_demo_configuration.sh | 4 ++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/actions/start-opensearch-with-one-plugin/action.yml b/.github/actions/start-opensearch-with-one-plugin/action.yml index 41b4b9426b..78a4f6dbc5 100644 --- a/.github/actions/start-opensearch-with-one-plugin/action.yml +++ b/.github/actions/start-opensearch-with-one-plugin/action.yml @@ -26,14 +26,14 @@ runs: # Download OpenSearch - name: Download OpenSearch for Windows - uses: peternied/download-file@v1 + uses: peternied/download-file@v2 if: ${{ runner.os == 'Windows' }} with: url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ inputs.opensearch-version }}-SNAPSHOT/opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip - name: Download OpenSearch for Linux - uses: peternied/download-file@v1 + uses: peternied/download-file@v2 if: ${{ runner.os == 'Linux' }} with: url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ inputs.opensearch-version }}-SNAPSHOT/opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-linux-x64-latest.tar.gz @@ -119,7 +119,6 @@ runs: Invoke-WebRequest -SkipCertificateCheck -Uri 'https://localhost:9200/_cat/plugins' -Headers $Headers; shell: pwsh - - name: Run sanity tests - uses: gradle/gradle-build-action@v2 - with: - arguments: integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="opensearch" -Dhttps=true -Duser=admin -Dpassword=admin + - if: always() + run: cat ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/logs/opensearch.log + shell: bash diff --git a/.github/workflows/plugin_install.yml b/.github/workflows/plugin_install.yml index 5e8f3028cb..e47c6dda2e 100644 --- a/.github/workflows/plugin_install.yml +++ b/.github/workflows/plugin_install.yml @@ -34,15 +34,14 @@ jobs: run: | cat > setup.sh <<'EOF' chmod +x ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh - /bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh" + /bin/bash -c "./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh -y" EOF - name: Create Setup Script if: ${{ runner.os == 'Windows' }} run: | New-Item .\setup.bat -type file - Set-Content .\setup.bat -Value "powershell.exe -noexit -command `"echo 'y' | .\opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT\plugins\${{ env.PLUGIN_NAME }}\tools\install_demo_configuration.bat`"" - Get-Content .\setup.bat + Set-Content .\setup.bat -Value "powershell.exe .\opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT\plugins\${{ env.PLUGIN_NAME }}\tools\install_demo_configuration.bat -y" - name: Run Opensearch with A Single Plugin uses: ./.github/actions/start-opensearch-with-one-plugin diff --git a/tools/install_demo_configuration.bat b/tools/install_demo_configuration.bat index 410df30b08..522fe50fc0 100755 --- a/tools/install_demo_configuration.bat +++ b/tools/install_demo_configuration.bat @@ -62,6 +62,11 @@ if %cluster_mode% == 0 ( ) ) +if %assumeyes% == 1 ( + set "initsecurity=1" + set "cluster_mode=1" +) + set BASE_DIR=%SCRIPT_DIR%\..\..\..\ if not exist %BASE_DIR% ( echo "basedir does not exist" diff --git a/tools/install_demo_configuration.sh b/tools/install_demo_configuration.sh index 287ded080c..d3d58d77b7 100755 --- a/tools/install_demo_configuration.sh +++ b/tools/install_demo_configuration.sh @@ -97,6 +97,10 @@ if [ "$cluster_mode" == 0 ] && [ "$assumeyes" == 0 ]; then esac fi +if [ "$assumeyes" == 1 ]; then + cluster_mode=1 + initsecurity=1 +fi set -e BASE_DIR="$DIR/../../.."