Skip to content

Commit 4b88d26

Browse files
authored
[CI] get package version yarn script (#193)
Utilize to pull the version in package.json and utilized in github workflows. Issues resolved: #142 #189 Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
1 parent 3056b74 commit 4b88d26

27 files changed

+198
-152
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ jobs:
1010
with:
1111
test-name: Alerting
1212
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/alerting-dashboards-plugin/*'
13-
version: 1.3.0

.github/workflows/anomaly-detection-release-e2e-workflow.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
uses: ./.github/workflows/release-e2e-workflow-template.yml
1010
with:
1111
test-name: Anomaly Detection
12-
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/*'
13-
version: 1.3.0
12+
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/anomaly-detection-dashboards-plugin/*'

.github/workflows/cypress-workflow-bundle-snapshot-based.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
branches:
99
- main
1010
- dev-*
11-
env:
12-
VERSION: '1.3.0'
1311
jobs:
1412
tests:
1513
name: Run Cypress E2E tests
@@ -24,16 +22,25 @@ jobs:
2422
uses: actions/setup-java@v1
2523
with:
2624
java-version: 14
25+
- name: Checkout monetery-test
26+
uses: actions/checkout@v2
27+
with:
28+
repository: ${{github.repository}}
29+
path: monetery-test
30+
- name: Get package version
31+
working-directory: monetery-test
32+
run: |
33+
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
2734
- name: Get and run OpenSearch
2835
run: |
29-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
36+
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
3037
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
3138
cd opensearch-${{ env.VERSION }}/
3239
./opensearch-tar-install.sh &
3340
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'
3441
- name: Get OpenSearch-Dashboards
3542
run: |
36-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
43+
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
3744
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
3845
- name: Get node and yarn versions
3946
id: versions
@@ -49,15 +56,10 @@ jobs:
4956
cd opensearch-dashboards-${{ env.VERSION }}
5057
bin/opensearch-dashboards serve &
5158
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
52-
- name: Checkout monterey-test
53-
uses: actions/checkout@v2
54-
with:
55-
repository: ${{github.repository}}
56-
path: monterey-test
5759
- name: Get Cypress version
5860
id: cypress_version
5961
run: |
60-
echo "::set-output name=cypress_version::$(cat ./monterey-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
62+
echo "::set-output name=cypress_version::$(cat ./monetery-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
6163
- name: Cache Cypress
6264
id: cache-cypress
6365
uses: actions/cache@v1
@@ -71,18 +73,18 @@ jobs:
7173
- name: Cypress tests
7274
uses: cypress-io/github-action@v2
7375
with:
74-
working-directory: monterey-test
76+
working-directory: monetery-test
7577
command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/*.js'
7678
wait-on: 'http://localhost:5601'
7779
# Screenshots are only captured on failure, will change this once we do visual regression tests
7880
- uses: actions/upload-artifact@v1
7981
if: failure()
8082
with:
8183
name: cypress-screenshots
82-
path: monterey-test/cypress/screenshots
84+
path: monetery-test/cypress/screenshots
8385
# Test run video was always captured, so this action uses "always()" condition
8486
- uses: actions/upload-artifact@v1
8587
if: always()
8688
with:
8789
name: cypress-videos
88-
path: monterey-test/cypress/videos
90+
path: monetery-test/cypress/videos

.github/workflows/cypress-workflow-plugins-bundle-snapshot-based.yml.disabled

+15-13
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
branches:
99
- main
1010
- dev-*
11-
env:
12-
VERSION: '1.3.0'
1311
jobs:
1412
tests:
1513
name: Run Cypress E2E tests
@@ -24,16 +22,25 @@ jobs:
2422
uses: actions/setup-java@v1
2523
with:
2624
java-version: 14
25+
- name: Checkout monetery-test
26+
uses: actions/checkout@v2
27+
with:
28+
repository: ${{github.repository}}
29+
path: monetery-test
30+
- name: Get package version
31+
working-directory: monetery-test
32+
run: |
33+
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
2734
- name: Get and run OpenSearch
2835
run: |
29-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
36+
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
3037
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
3138
cd opensearch-${{ env.VERSION }}/
3239
./opensearch-tar-install.sh &
3340
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'
3441
- name: Get OpenSearch-Dashboards
3542
run: |
36-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
43+
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
3744
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
3845
- name: Get node and yarn versions
3946
id: versions
@@ -49,15 +56,10 @@ jobs:
4956
cd opensearch-dashboards-${{ env.VERSION }}
5057
bin/opensearch-dashboards serve &
5158
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
52-
- name: Checkout monterey-test
53-
uses: actions/checkout@v2
54-
with:
55-
repository: ${{github.repository}}
56-
path: monterey-test
5759
- name: Get Cypress version
5860
id: cypress_version
5961
run: |
60-
echo "::set-output name=cypress_version::$(cat ./monterey-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
62+
echo "::set-output name=cypress_version::$(cat ./monetery-test/package.json | jq '.devDependencies.cypress' | tr -d '"')"
6163
- name: Cache Cypress
6264
id: cache-cypress
6365
uses: actions/cache@v1
@@ -71,18 +73,18 @@ jobs:
7173
- name: Cypress tests
7274
uses: cypress-io/github-action@v2
7375
with:
74-
working-directory: monterey-test
76+
working-directory: monetery-test
7577
command: yarn cypress:run-plugin-tests-with-security --browser chromium
7678
wait-on: 'http://localhost:5601'
7779
# Screenshots are only captured on failure, will change this once we do visual regression tests
7880
- uses: actions/upload-artifact@v1
7981
if: failure()
8082
with:
8183
name: cypress-screenshots
82-
path: monterey-test/cypress/screenshots
84+
path: monetery-test/cypress/screenshots
8385
# Test run video was always captured, so this action uses "always()" condition
8486
- uses: actions/upload-artifact@v1
8587
if: always()
8688
with:
8789
name: cypress-videos
88-
path: monterey-test/cypress/videos
90+
path: monetery-test/cypress/videos

.github/workflows/cypress-workflow-vanilla-snapshot-based.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010
- dev-*
1111
env:
12-
VERSION: '1.3.0'
12+
VERSION: '2.0.0'
1313
jobs:
1414
tests:
1515
name: Run Cypress E2E tests
@@ -24,6 +24,16 @@ jobs:
2424
uses: actions/setup-java@v1
2525
with:
2626
java-version: 14
27+
- name: Checkout monetery-test
28+
uses: actions/checkout@v2
29+
with:
30+
repository: ${{github.repository}}
31+
path: monetery-test
32+
# TODO: Qualifier not supported yet for OSD snapshot
33+
# - name: Get package version
34+
# working-directory: monetery-test
35+
# run: |
36+
# echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
2737
- name: Get and run OpenSearch
2838
run: |
2939
wget https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.VERSION }}-SNAPSHOT/opensearch-min-${{ env.VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz
@@ -49,11 +59,6 @@ jobs:
4959
cd opensearch-dashboards-${{ env.VERSION }}-SNAPSHOT-linux-x64
5060
bin/opensearch-dashboards serve &
5161
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
52-
- name: Checkout Monterey test cases
53-
uses: actions/checkout@v2
54-
with:
55-
repository: ${{github.repository}}
56-
path: monetery-test
5762
- name: Get Cypress version
5863
id: cypress_version
5964
run: |

.github/workflows/cypress-workflow-vanilla-source-based.yml.disabled

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ jobs:
2323
with:
2424
java-version: 14
2525
# dependencies: OpenSearch
26+
- name: Checkout monetery-test
27+
uses: actions/checkout@v2
28+
with:
29+
repository: ${{github.repository}}
30+
path: monetery-test
31+
- name: Get package version
32+
working-directory: monetery-test
33+
run: |
34+
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
2635
- name: Checkout OpenSearch
2736
uses: actions/checkout@v2
2837
with:

.github/workflows/gantt-chart-release-e2e-workflow.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
uses: ./.github/workflows/release-e2e-workflow-template.yml
1010
with:
1111
test-name: Gantt Chart
12-
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/gantt-chart-dashboards/*'
13-
version: 1.3.0
12+
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/gantt-chart-dashboards/*'

.github/workflows/index-management-release-e2e-workflow.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
uses: ./.github/workflows/release-e2e-workflow-template.yml
1010
with:
1111
test-name: Index Management
12-
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/index-management-dashboards-plugin/*'
13-
version: 1.3.0
12+
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/index-management-dashboards-plugin/*'

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
uses: ./.github/workflows/release-e2e-workflow-template.yml
1010
with:
1111
test-name: Observability
12-
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/observability-dashboards/*'
13-
version: 1.3.0
12+
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/observability-dashboards/*'

.github/workflows/query-workbench-release-e2e-workflow.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ jobs:
99
uses: ./.github/workflows/release-e2e-workflow-template.yml
1010
with:
1111
test-name: Query Workbench
12-
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/query-workbench-dashboards/*'
13-
version: 1.3.0
12+
test-command: yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/plugins/query-workbench-dashboards/*'

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

+11-12
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
test-command:
99
required: true
1010
type: string
11-
version:
12-
required: true
13-
type: string
14-
env:
15-
VERSION: ${{ inputs.version }}
1611
jobs:
1712
tests:
1813
name: Run Cypress E2E tests for ${{ inputs.test-name }}
@@ -27,16 +22,25 @@ jobs:
2722
uses: actions/setup-java@v1
2823
with:
2924
java-version: 14
25+
- name: Checkout cypress-test
26+
uses: actions/checkout@v2
27+
with:
28+
repository: ${{github.repository}}
29+
path: cypress-test
30+
- name: Get package version
31+
working-directory: cypress-test
32+
run: |
33+
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
3034
- name: Get and run OpenSearch
3135
run: |
32-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
36+
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
3337
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
3438
cd opensearch-${{ env.VERSION }}/
3539
./opensearch-tar-install.sh &
3640
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'
3741
- name: Get OpenSearch-Dashboards
3842
run: |
39-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
43+
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
4044
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
4145
- name: Get node and yarn versions
4246
id: versions
@@ -52,11 +56,6 @@ jobs:
5256
cd opensearch-dashboards-${{ env.VERSION }}
5357
bin/opensearch-dashboards serve &
5458
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
55-
- name: Checkout cypress-test
56-
uses: actions/checkout@v2
57-
with:
58-
repository: ${{github.repository}}
59-
path: cypress-test
6059
- name: Get Cypress version
6160
id: cypress_version
6261
run: |

.github/workflows/release-signoff-chrome.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Release signoff for bundled OpenSearch Dashboards with Dashboards plugins
22
on:
33
schedule:
44
- cron: '0 */3 * * *'
5-
env:
6-
VERSION: '1.3.0'
75
jobs:
86
tests:
97
name: Run Cypress E2E tests
@@ -14,16 +12,25 @@ jobs:
1412
# avoid warnings like "tput: No value for $TERM and no -T specified"
1513
TERM: xterm
1614
steps:
15+
- name: Checkout functional-test
16+
uses: actions/checkout@v2
17+
with:
18+
repository: ${{github.repository}}
19+
path: functional-test
20+
- name: Get package version
21+
working-directory: functional-test
22+
run: |
23+
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
1724
- name: Get and run OpenSearch
1825
run: |
19-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.VERSION }}/latest/linux/x64/dist/opensearch/opensearch-${{ env.VERSION }}-linux-x64.tar.gz
26+
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
2027
tar -xzf opensearch-${{ env.VERSION }}-linux-x64.tar.gz
2128
cd opensearch-${{ env.VERSION }}/
2229
./opensearch-tar-install.sh &
2330
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'
2431
- name: Get OpenSearch-Dashboards
2532
run: |
26-
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/${{ env.VERSION }}/latest/linux/x64/dist/opensearch-dashboards/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
33+
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
2734
tar -xzf opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz
2835
- name: Get node and yarn versions
2936
id: versions
@@ -39,11 +46,6 @@ jobs:
3946
cd opensearch-dashboards-${{ env.VERSION }}
4047
bin/opensearch-dashboards serve &
4148
timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
42-
- name: Checkout functional-test
43-
uses: actions/checkout@v2
44-
with:
45-
repository: ${{github.repository}}
46-
path: functional-test
4749
- name: Get Cypress version
4850
id: cypress_version
4951
run: |

0 commit comments

Comments
 (0)