diff --git a/.github/workflows/kibana_reports_release_workflow.yml b/.github/workflows/kibana-reports-release-workflow.yml similarity index 88% rename from .github/workflows/kibana_reports_release_workflow.yml rename to .github/workflows/kibana-reports-release-workflow.yml index 7d3e51ae..81bb1fce 100644 --- a/.github/workflows/kibana_reports_release_workflow.yml +++ b/.github/workflows/kibana-reports-release-workflow.yml @@ -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/*" diff --git a/.github/workflows/kibana_reports_test_and_build_workflow.yml b/.github/workflows/kibana-reports-test-and-build-workflow.yml similarity index 84% rename from .github/workflows/kibana_reports_test_and_build_workflow.yml rename to .github/workflows/kibana-reports-test-and-build-workflow.yml index dc02a920..521fd0d8 100644 --- a/.github/workflows/kibana_reports_test_and_build_workflow.yml +++ b/.github/workflows/kibana-reports-test-and-build-workflow.yml @@ -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: diff --git a/.github/workflows/reports-scheduler-release-workflow.yml b/.github/workflows/reports-scheduler-release-workflow.yml new file mode 100644 index 00000000..47e1dc34 --- /dev/null +++ b/.github/workflows/reports-scheduler-release-workflow.yml @@ -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/*" diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml new file mode 100644 index 00000000..0c82b42e --- /dev/null +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -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