Skip to content

Commit

Permalink
Setup github action for reports-scheduler (opensearch-project#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongnansu authored Oct 30, 2020
1 parent de6566e commit afa9cc0
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,23 @@ jobs:
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 60
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn kbn bootstrap

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

- name: Build Artifact
run: |
cd kibana/plugins/kibana-reports
yarn build
artifact=`ls ./build/*.zip`
# TODO: rename S3 bucket path after infra team assigns one
aws s3 cp $artifact s3://kiabna-reports/kibana-reports-plugin/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,22 @@ jobs:
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 60
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/kibana-reports; yarn kbn bootstrap

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

- name: Build Artifact
run: |
cd kibana/plugins/kibana-reports
yarn build
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/reports-scheduler-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Reports Scheduler Artifacts
# This workflow is triggered on creating tags to master or an opendistro release branch
on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Checkout Plugin
uses: actions/checkout@v1

- name: Set up JDK 1.14
uses: actions/setup-java@v1
with:
java-version: 1.14

- name: Run build
run: |
cd reports-scheduler
./gradlew build buildDeb buildRpm --no-daemon --refresh-dependencies -Dbuild.snapshot=false
artifact=`ls plugin/build/distributions/*.zip`
rpm_artifact=`ls plugin/build/distributions/*.rpm`
deb_artifact=`ls plugin/build/distributions/*.deb`
# TODO: rename S3 bucket path after infra team assigns one
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-plugins/opendistro-sql/
aws s3 cp $rpm_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/rpms/opendistro-sql/
aws s3 cp $deb_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/debs/opendistro-sql/
aws cloudfront create-invalidation --distribution-id E1VG5HMIWI4SA2 --paths "/downloads/*"
31 changes: 31 additions & 0 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test and Build Reports Scheduler

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.14
uses: actions/setup-java@v1
with:
java-version: 1.14

- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build
- name: Create Artifact Path
run: |
mkdir -p reports-scheduler-builds
cp -r ./reports-scheduler/build/distributions/*.zip reports-scheduler-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: reports-scheduler
path: reports-scheduler-builds

0 comments on commit afa9cc0

Please sign in to comment.