Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add cd.yml and enable CD pipeline to upload artifact to S3 (#90)
Browse files Browse the repository at this point in the history
* add cd.yml

* upgrade ospackage version to 8.2.0

* change s3

* update cd.yml
  • Loading branch information
rguo-aws committed Mar 31, 2020
1 parent aa4ad4d commit cfd9571
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/cd.yml
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/
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ buildscript {

plugins {
id 'java'
id 'nebula.ospackage' version "8.0.1"
id 'nebula.ospackage' version "8.2.0"
}

ext {
Expand Down

0 comments on commit cfd9571

Please sign in to comment.