diff --git a/.github/actions/start-opensearch-with-one-plugin/action.yml b/.github/actions/start-opensearch-with-one-plugin/action.yml index d75dc6fd13..fd838a6cbf 100644 --- a/.github/actions/start-opensearch-with-one-plugin/action.yml +++ b/.github/actions/start-opensearch-with-one-plugin/action.yml @@ -1,4 +1,4 @@ -name: 'Start OpenSearch with One Plugin' +name: 'Launch OpenSearch with a single plugin installed' description: 'Downloads latest build of OpenSearch, installs a plugin, executes a script and then starts OpenSearch on localhost:9200' inputs: @@ -10,14 +10,10 @@ inputs: description: 'The name of the plugin to use, such as opensearch-security' required: true - plugin-start-script: - description: 'The file name for the configuration script for the plugin such as install_demo_configurations -- may not be needed for every plugin' + setup-script-name: + description: 'The name of the setup script you want to run i.e. "setup" (do not include file extension). Leave empty to indicate one should not be run.' required: false - docker-host-plugin-zip: - description: 'The name of the zip file for the plugin hosted on docker-host i.e. security-plugin.zip ' - required: true - runs: using: "composite" steps: @@ -29,25 +25,28 @@ runs: shell: pwsh # Download OpenSearch - - uses: peternied/download-file@v1 + - name: Download OpenSearch for Windows + uses: peternied/download-file@v1 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 - - uses: peternied/download-file@v1 + + - name: Download OpenSearch for Linux + uses: peternied/download-file@v1 if: ${{ runner.os == 'Linux' }} with: - url: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ inputs.opensearch-version }}/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-${{ inputs.opensearch-version }}-linux-x64.tar.gz + url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ inputs.opensearch-version }}-SNAPSHOT/opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-linux-x64-latest.tar.gz # Extract downloaded zip - - name: Extract downloaded zip for Linux + - name: Extract downloaded tar if: ${{ runner.os == 'Linux' }} run: | tar -xzf opensearch-*.tar.gz rm -f opensearch-*.tar.gz shell: bash - - name: Extract downloaded zip for Windows + - name: Extract downloaded zip if: ${{ runner.os == 'Windows' }} run: | tar -xzf opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip @@ -59,41 +58,38 @@ runs: run: mv ./build/distributions/${{ inputs.plugin-name }}-*.zip ${{ inputs.plugin-name }}.zip shell: bash - # Install the plugin, runs its start-script, and start the OpenSearch server + # Install the plugin - name: Install Plugin into OpenSearch for Linux if: ${{ runner.os == 'Linux'}} run: | - cat > os-ep.sh < 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" + 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 - name: Run Opensearch with A Single Plugin uses: ./.github/actions/start-opensearch-with-one-plugin with: - opensearch-version: 3.0.0 - plugin-name: opensearch-security - plugin-start-script: install_demo_configuration - docker-host-plugin-zip: security-plugin.zip + opensearch-version: ${{ env.OPENSEARCH_VERSION }} + plugin-name: ${{ env.PLUGIN_NAME }} + setup-script-name: setup - name: Run sanity tests uses: gradle/gradle-build-action@v2