This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cd.yml and enable CD pipeline to upload artifact to S3 (#90)
* add cd.yml * upgrade ospackage version to 8.2.0 * change s3 * update cd.yml
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Set up JDK 13 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 13.0.x | ||
|
||
- name: Checkout Performance Analyzer package | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
run: | | ||
./gradlew build buildDeb buildRpm --refresh-dependencies -Dbuild.snapshot=false -x javadoc | ||
mkdir artifacts | ||
artifact=`ls build/distributions/*.zip` | ||
rpm_artifact=`ls build/distributions/*.rpm` | ||
deb_artifact=`ls build/distributions/*.deb` | ||
cp $artifact artifacts/ | ||
cp $rpm_artifact artifacts/ | ||
cp $deb_artifact artifacts/ | ||
- 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-west-2 | ||
|
||
- name: Upload Artifacts to S3 | ||
run: | | ||
s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads | ||
aws s3 cp artifacts/*.zip $s3_path/elasticsearch-plugins/performance-analyzer/ | ||
aws s3 cp artifacts/*.rpm $s3_path/rpms/opendistro-performance-analyzer/ | ||
aws s3 cp artifacts/*.deb $s3_path/debs/opendistro-performance-analyzer/ | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*" | ||
- name: Upload Workflow Artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: artifacts | ||
path: artifacts/ |
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