Skip to content

Commit

Permalink
Fix behavior of assume yes in install_demo_configuration tool (#2308)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <[email protected]>
  • Loading branch information
stephen-crawford authored Dec 7, 2022
1 parent 9ae87ae commit aad9379
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/actions/start-opensearch-with-one-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,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
2 changes: 1 addition & 1 deletion .github/workflows/bwc-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Backwards Compability Suite
name: Backwards Compatibility Suite

on: [workflow_dispatch]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/plugin_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,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`""
Set-Content .\setup.bat -Value "powershell.exe .\opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT\plugins\${{ env.PLUGIN_NAME }}\tools\install_demo_configuration.bat -y"
Get-Content .\setup.bat
- name: Run Opensearch with A Single 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 @@ -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/../../.."
Expand Down

0 comments on commit aad9379

Please sign in to comment.