Skip to content

[Feature] Handle source as both string and json object #1362

[Feature] Handle source as both string and json object

[Feature] Handle source as both string and json object #1362

name: 'Install Query Insights Dashboards with Plugin via Binary'
on: [push, pull_request]
env:
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123!
jobs:
verify-binary-installation:
name: Run binary installation
strategy:
fail-fast: false
matrix:
# TODO: add windows support when OSD core is stable on windows
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Check working directory and list files
run: |
echo "Current Directory: $(pwd)"
echo "Listing files:"
ls -la
- name: Set env from opensearch_dashboards.json
run: |
opensearch_version=$(node -p "require('./opensearch_dashboards.json').opensearchDashboardsVersion")
plugin_version=$(node -p "require('./package.json').version")
echo "OPENSEARCH_VERSION=$opensearch_version" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
shell: bash
- name: Run OpenSearch
uses: derek-ho/start-opensearch@v6
with:
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
security-enabled: false
jdk-version: 21
- name: Run Dashboard
id: setup-dashboards
uses: derek-ho/setup-opensearch-dashboards@v1
with:
plugin_name: query-insights-dashboards
built_plugin_name: queryInsightsDashboards
install_zip: true
- name: Start the binary
run: |
nohup ./bin/opensearch-dashboards &
working-directory: ${{ steps.setup-dashboards.outputs.dashboards-binary-directory }}
shell: bash
- name: Health check
run: |
timeout 300 bash -c 'while [[ "$(curl -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
shell: bash