Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Update workflow to build artifact for ARM64 #228

Merged
merged 5 commits into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions .github/workflows/kibana-reports-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,58 @@ jobs:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins/opendistroReportsKibana
run: mv kibana-reports kibana/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd kibana/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip

- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/opendistroReportsKibana; yarn kbn bootstrap
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/opendistroReportsKibana; yarn test
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/opendistroReportsKibana
cd kibana/plugins/${{ env.PLUGIN_NAME }}
yarn build

cd build
mkdir -p ./{linux,windows}/kibana/opendistroReportsKibana
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/kibana/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip

cd linux-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..

cd linux
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux.zip
unzip chromium-linux.zip -d ./kibana/opendistroReportsKibana
cd linux-arm64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..

cd windows
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows.zip
unzip chromium-windows.zip -d ./kibana/opendistroReportsKibana
cd windows-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
unzip chromium-windows-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
Expand Down
58 changes: 36 additions & 22 deletions .github/workflows/kibana-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,62 +26,76 @@ jobs:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins/opendistroReportsKibana
run: mv kibana-reports kibana/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is missing in the release flow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, although I think we only need to test in CI, shouldn't need to test in CD?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may be a requirement from infra team, guess all the plugins are doing this way

sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd kibana/plugins/opendistroReportsKibana
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux.zip
unzip chromium-linux.zip
rm chromium-linux.zip
cd kibana/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip

- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/opendistroReportsKibana; yarn kbn bootstrap
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/opendistroReportsKibana; yarn test
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/opendistroReportsKibana
cd kibana/plugins/${{ env.PLUGIN_NAME }}
yarn build

cd build
mkdir -p ./{linux,windows}/kibana/opendistroReportsKibana
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/kibana/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip

cd linux
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux.zip
unzip chromium-linux.zip -d ./kibana/opendistroReportsKibana
cd linux-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..

cd windows
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows.zip
unzip chromium-windows.zip -d ./kibana/opendistroReportsKibana
cd linux-arm64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..

- name: Upload Artifact For Linux
cd windows-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
unzip chromium-windows-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..

- name: Upload Artifact For Linux x64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip

- name: Upload Artifact For Linux arm64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux
path: kibana/plugins/opendistroReportsKibana/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
name: kibana-reports-linux-arm64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip

- name: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: kibana-reports-windows
path: kibana/plugins/opendistroReportsKibana/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
name: kibana-reports-windows-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
1 change: 1 addition & 0 deletions kibana-reports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"jquery": "^3.5.0",
"jsdom": "13.1.0",
"json-2-csv": "^3.7.6",
"puppeteer-core": "^1.19.0",
"react-addons-test-utils": "^15.6.2",
"react-id-generator": "^3.0.1",
"react-markdown": "^4.3.1",
Expand Down
Loading