diff --git a/.github/actions/install-dashboards/action.yml b/.github/actions/install-dashboards/action.yml index 7dae184e8..d9b7d9eb0 100644 --- a/.github/actions/install-dashboards/action.yml +++ b/.github/actions/install-dashboards/action.yml @@ -15,7 +15,6 @@ outputs: description: "The directory where the plugin has been configured" value: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} - runs: using: "composite" steps: @@ -25,7 +24,6 @@ runs: - id: determine-plugin-directory run: echo "::set-output name=plugin-directory::./OpenSearch-Dashboards/plugins/${{ inputs.plugin_name }}" - # run: echo "plugin-directory=./OpenSearch-Dashboards/plugins/${{ inputs.plugin_name }}" >> $GITHUB_OUTPUT shell: bash - uses: actions/checkout@v2 @@ -42,7 +40,6 @@ runs: - uses: actions/checkout@v2 with: path: ${{ steps.determine-plugin-directory.outputs.plugin-directory }} - # ref: ${{ github.ref }} - id: osd-version continue-on-error: true diff --git a/.github/workflows/cypress-test.yml b/.github/workflows/cypress-test.yml index 0ba215226..51cf78bbc 100644 --- a/.github/workflows/cypress-test.yml +++ b/.github/workflows/cypress-test.yml @@ -9,95 +9,45 @@ env: START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --opensearch_security.multitenancy.enable_aggregation_view=true' OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot' SPEC: 'cypress/integration/plugins/security-dashboards-plugin/aggregation_view.js,' + OPENSEARCH_VERSION: 3.0.0 + PLUGIN_NAME: opensearch-security + PLUGIN_VERSION: 3.0.0.0 jobs: tests: - name: Run aggregation view cypress test + name: Run Cypress tests runs-on: ubuntu-latest steps: - - name: Download OpenSearch Core - run: | - wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-3.0.0-linux-x64.tar.gz - tar -xzf opensearch-*.tar.gz - rm -f opensearch-*.tar.gz - + - name: Checkout Branch + uses: actions/checkout@v2 + - name: Download OpenSearch Security Plugin - run: wget -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-3.0.0.0.zip - - - - name: Run OpenSearch with plugin + run: wget --progress=bar:force:noscroll -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.OPENSEARCH_VERSION }}/latest/linux/x64/tar/builds/opensearch/plugins/${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip + + - name: Create Setup Script + if: ${{ runner.os == 'Linux' }} run: | - cat > os-ep.sh <> /opensearch/config/opensearch.yml - chown 1001:1001 -R /opensearch - su -c "/opensearch/bin/opensearch" -s /bin/bash opensearch + 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" EOF - docker build -t opensearch-test:latest -f- . <> ./config/opensearch_dashboards.yml echo 'opensearch.hosts: ["https://localhost:9200"]' >> ./config/opensearch_dashboards.yml echo 'opensearch.ssl.verificationMode: none' >> ./config/opensearch_dashboards.yml diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 2861fdbb8..2b692ef5d 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -5,57 +5,47 @@ on: [push, pull_request] env: TEST_BROWSER_HEADLESS: 1 CI: 1 + OPENSEARCH_VERSION: 3.0.0 + PLUGIN_NAME: opensearch-security + PLUGIN_VERSION: 3.0.0.0 jobs: tests: name: Run integration tests runs-on: ubuntu-latest steps: + - name: Checkout Branch + uses: actions/checkout@v2 + - uses: browser-actions/setup-geckodriver@latest - run: geckodriver --version - uses: browser-actions/setup-firefox@latest - run: firefox --version - - - name: Download OpenSearch Core - run: | - wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-3.0.0-linux-x64.tar.gz - tar -xzf opensearch-*.tar.gz - rm -f opensearch-*.tar.gz - name: Download OpenSearch Security Plugin - run: wget -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/3.0.0/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-3.0.0.0.zip - - - - name: Run OpenSearch with plugin + run: wget --progress=bar:force:noscroll -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.OPENSEARCH_VERSION }}/latest/linux/x64/tar/builds/opensearch/plugins/${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip + + - name: Create Setup Script + if: ${{ runner.os == 'Linux' }} run: | - cat > os-ep.sh <> /opensearch/config/opensearch.yml - chown 1001:1001 -R /opensearch - su -c "/opensearch/bin/opensearch" -s /bin/bash opensearch - EOF - docker build -t opensearch-test:latest -f- . < 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" + echo "plugins.security.unsupported.restapi.allow_securityconfig_modification: true" >> ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/config/opensearch.yml EOF - docker run -d --network=host -i opensearch-test:latest - - uses: actions/checkout@v2 + - name: Run Opensearch with A Single Plugin + uses: opensearch-project/security/.github/actions/start-opensearch-with-one-plugin@main + with: + opensearch-version: ${{ env.OPENSEARCH_VERSION }} + plugin-name: ${{ env.PLUGIN_NAME }} + setup-script-name: setup - id: install-dashboards uses: ./.github/actions/install-dashboards with: - plugin_name: security-dashboards-plugin + plugin_name: security-dashboards-plugin - name: Start Dashboards in background run: node scripts/build_opensearch_dashboards_platform_plugins.js diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 63c5feb57..8b8dd02cf 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -16,7 +16,8 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true - - uses: actions/checkout@v2 + - name: Checkout Branch + uses: actions/checkout@v2 - id: install-dashboards uses: ./.github/actions/install-dashboards