forked from opensearch-project/reporting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup github action for reports-scheduler (opensearch-project#164)
- Loading branch information
1 parent
de6566e
commit afa9cc0
Showing
4 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
31
.github/workflows/reports-scheduler-test-and-build-workflow.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |