Skip to content

Commit

Permalink
Use puppeteer-core with custom chromium instead of puppeteer (opensea…
Browse files Browse the repository at this point in the history
…rch-project#222)

* Use custom chrome binary

* Update chromium path

* Test workflow for al2

* Disable tests temporarily

* Fix workflow

Fix workflow

* Rename opendistroKibanaReports to opendistroReportsKibana

* Update workflows

Fix workflow

Update workflows

Update workflows

* Enable tests in workflows

* Add windows chromium to workflows

* Fix tests

* Use path.posix.normalize to accomondate windows

* Use @types/puppeteer-core
  • Loading branch information
joshuali925 authored Nov 30, 2020
1 parent c40450c commit 753c4c9
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 16 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/kibana-reports-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,47 @@ jobs:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins
run: mv kibana-reports kibana/plugins/opendistroReportsKibana

- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn kbn bootstrap
command: cd kibana/plugins/opendistroReportsKibana; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn test
command: cd kibana/plugins/opendistroReportsKibana; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/kibana-reports
cd kibana/plugins/opendistroReportsKibana
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
artifact=`ls ./build/*.zip`
# TODO: rename S3 bucket path after infra team assigns one
aws s3 cp $artifact s3://kiabna-reports/kibana-reports-plugin/
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
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
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
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
artifact=`ls ./${{ env.PLUGIN_NAME }}-*.zip`
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/kibana-plugins/opendistro-reports/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
48 changes: 40 additions & 8 deletions .github/workflows/kibana-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,62 @@ jobs:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins
run: mv kibana-reports kibana/plugins/opendistroReportsKibana

- name: Add Chromium Binary to Reporting for Testing
run: |
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
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn kbn bootstrap
command: cd kibana/plugins/opendistroReportsKibana; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn test
command: cd kibana/plugins/opendistroReportsKibana; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/kibana-reports
cd kibana/plugins/opendistroReportsKibana
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
- name: Upload Artifact
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
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
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
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
- name: Upload Artifact For Linux
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: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: kibana-reports
path: kibana/plugins/kibana-reports/build
name: kibana-reports-windows
path: kibana/plugins/opendistroReportsKibana/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip

0 comments on commit 753c4c9

Please sign in to comment.