Skip to content

Commit 12c20ab

Browse files
committed
reverted workflow
Signed-off-by: sumukhswamy <sumukhhs@amazon.com>
1 parent 5a71721 commit 12c20ab

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

.github/workflows/release-e2e-workflow-template.yml

+42-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
test-command:
99
required: true
1010
type: string
11+
osd-serve-args:
12+
required: false
13+
type: string
14+
security-enabled:
15+
required: false
16+
type: string
1117
jobs:
1218
tests:
1319
name: Run Cypress E2E tests for ${{ inputs.test-name }}
@@ -31,21 +37,39 @@ jobs:
3137
working-directory: cypress-test
3238
run: |
3339
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
40+
- name: Get security setups
41+
run: |
42+
SECURITY_ENABLED=${{ inputs.security-enabled }}
43+
if [ "$SECURITY_ENABLED" != 'false' ]; then
44+
echo "SECURITY_ENABLED=true" >> $GITHUB_ENV
45+
else
46+
echo "SECURITY_ENABLED=false" >> $GITHUB_ENV
47+
fi
3448
- name: Get and run OpenSearch
3549
run: |
3650
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
3751
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
3852
cd opensearch-${{ env.VERSION }}/
39-
./opensearch-tar-install.sh &
40-
timeout 900 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
53+
if [ "$SECURITY_ENABLED" = 'false' ]; then
54+
echo "Remove OpenSearch Security"
55+
[ -d "plugins/opensearch-security" ] && echo "plugins.security.disabled: true" >> config/opensearch.yml
56+
./opensearch-tar-install.sh &
57+
timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' http://localhost:9200)" != "200" ]]; do sleep 5; done'
58+
curl http://localhost:9200
59+
else
60+
echo "Keep OpenSearch Security"
61+
./opensearch-tar-install.sh &
62+
timeout 900 bash -c 'while [[ "$(curl -o /dev/null -w ''%{http_code}'' -u admin:admin -k https://localhost:9200)" != "200" ]]; do sleep 5; done'
63+
curl https://localhost:9200 -u admin:admin --insecure
64+
fi
4165
- name: Get OpenSearch-Dashboards
4266
run: |
4367
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
4468
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
4569
- name: Get node and yarn versions
4670
id: versions
4771
run: |
48-
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}-linux-x64/package.json').engines.node).match(/[.0-9]+/)[0]")"
72+
echo "::set-output name=node_version::$(node -p "(require('./opensearch-dashboards-${{ env.VERSION }}/package.json').engines.node).match(/[.0-9]+/)[0]")"
4973
- name: Setup node
5074
uses: actions/setup-node@v1
5175
with:
@@ -54,8 +78,20 @@ jobs:
5478
- name: Run OpenSearch-Dashboards server
5579
run: |
5680
cd opensearch-dashboards-${{ env.VERSION }}
57-
bin/opensearch-dashboards serve &
58-
timeout 300 bash -c 'while [[ "$(curl -s -u admin:admin -k localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
81+
if [ "$SECURITY_ENABLED" = 'false' ]; then
82+
echo "Remove Dashboards Security"
83+
./bin/opensearch-dashboards-plugin remove securityDashboards
84+
sed -i /^opensearch_security/d config/opensearch_dashboards.yml
85+
sed -i 's/https/http/' config/opensearch_dashboards.yml
86+
bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} &
87+
timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
88+
curl http://localhost:5601/api/status
89+
else
90+
echo "Keep Dashboards Security"
91+
bin/opensearch-dashboards serve ${{ inputs.osd-serve-args }} &
92+
timeout 300 bash -c 'while [[ "$(curl -u admin:admin -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
93+
curl http://localhost:5601/api/status -u admin:admin --insecure
94+
fi
5995
- name: Get Cypress version
6096
id: cypress_version
6197
run: |
@@ -93,4 +129,4 @@ jobs:
93129
if: always()
94130
with:
95131
name: cypress-results
96-
path: cypress-test/cypress/results
132+
path: cypress-test/cypress/results

0 commit comments

Comments
 (0)