Initial commit to try using workflow from other fork #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Install Dashboards with Plugin via Binary' | |
on: [push, pull_request] | |
env: | |
OPENSEARCH_VERSION: '3.0.0' | |
CI: 1 | |
# avoid warnings like "tput: No value for $TERM and no -T specified" | |
TERM: xterm | |
PLUGIN_NAME: opensearch-security-analytics | |
OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123! | |
jobs: | |
verify-binary-installation: | |
name: Run binary installation | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
# TODO: add windows support when OSD core is stable on windows | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Branch | |
uses: actions/checkout@v3 | |
- name: Download security plugin and create setup scripts | |
uses: derek-ho/security-dashboards-plugin/.github/actions/download-install-run-dashboards-with-plugin@generalize-binary-install-workflow | |
with: | |
opensearch-version: ${{ env.OPENSEARCH_VERSION }} | |
security-enabled: false | |
- uses: actions/checkout@v2 | |
with: | |
path: OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin | |
- name: Install dependencies | |
run: | | |
yarn osd bootstrap | |
working-directory: OpenSearch-Dashboards | |
shell: bash | |
- name: Build Plugin Zip | |
run: | | |
yarn build | |
working-directory: OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin | |
shell: bash | |
- name: Install plugin to OSD Linux | |
run: | | |
build/opensearch-dashboards-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT-linux-x64/bin/opensearch-dashboards-plugin install file:$(pwd)/plugins/security--analytics-dashboards-plugin/build/security-analytics-dashboards-${{env.PLUGIN_VERSION}}.zip | |
working-directory: OpenSearch-Dashboards | |
shell: bash | |
- name: Start the binary | |
run: | | |
nohup ./bin/opensearch-dashboards & | |
working-directory: OpenSearch-Dashboards/build/opensearch-dashboards-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT-linux-x64 | |
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 | |