Skip to content
16 changes: 7 additions & 9 deletions .github/actions/start-opensearch-with-one-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
required: true

setup-script-name:
description: 'The name of the setup script you want to run i.e. "setup" (do not include file extension). Leave this field empty to indicate no script should be run.'
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

runs:
Expand All @@ -26,14 +26,13 @@ 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
Expand All @@ -53,11 +52,6 @@ runs:
del opensearch-min-${{ inputs.opensearch-version }}-SNAPSHOT-windows-x64-latest.zip
shell: pwsh

# Move and rename the plugin for installation
- name: Move and rename the plugin for installation
run: mv ./build/distributions/${{ inputs.plugin-name }}-*-SNAPSHOT.zip ${{ inputs.plugin-name }}.zip
shell: bash

# Install the plugin
- name: Install Plugin into OpenSearch for Linux
if: ${{ runner.os == 'Linux'}}
Expand Down Expand Up @@ -118,3 +112,7 @@ runs:
$Headers = @{ Authorization = $baseCredentials }
Invoke-WebRequest -SkipCertificateCheck -Uri 'https://localhost:9200/_cat/plugins' -Headers $Headers;
shell: pwsh

- if: always()
run: cat ./opensearch-${{ inputs.opensearch-version }}-SNAPSHOT/logs/opensearch.log
shell: bash
10 changes: 7 additions & 3 deletions .github/workflows/plugin_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ jobs:
with:
arguments: assemble

# Move and rename the plugin for installation
- name: Move and rename the plugin for installation
run: mv ./build/distributions/${{ env.PLUGIN_NAME }}-*-SNAPSHOT.zip ${{ env.PLUGIN_NAME }}.zip
shell: bash

- name: Create Setup Script
if: ${{ runner.os == 'Linux' }}
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
Expand Down
5 changes: 5 additions & 0 deletions tools/install_demo_configuration.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions tools/install_demo_configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,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/../../.."
Expand Down