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

Commit cfd9571

Browse files
authored
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
1 parent aa4ad4d commit cfd9571

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

.github/workflows/cd.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
14+
- name: Set up JDK 13
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 13.0.x
18+
19+
- name: Checkout Performance Analyzer package
20+
uses: actions/checkout@v2
21+
22+
- name: Build
23+
run: |
24+
./gradlew build buildDeb buildRpm --refresh-dependencies -Dbuild.snapshot=false -x javadoc
25+
mkdir artifacts
26+
artifact=`ls build/distributions/*.zip`
27+
rpm_artifact=`ls build/distributions/*.rpm`
28+
deb_artifact=`ls build/distributions/*.deb`
29+
cp $artifact artifacts/
30+
cp $rpm_artifact artifacts/
31+
cp $deb_artifact artifacts/
32+
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v1
35+
with:
36+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
37+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
38+
aws-region: us-west-2
39+
40+
- name: Upload Artifacts to S3
41+
run: |
42+
s3_path=s3://artifacts.opendistroforelasticsearch.amazon.com/downloads
43+
aws s3 cp artifacts/*.zip $s3_path/elasticsearch-plugins/performance-analyzer/
44+
aws s3 cp artifacts/*.rpm $s3_path/rpms/opendistro-performance-analyzer/
45+
aws s3 cp artifacts/*.deb $s3_path/debs/opendistro-performance-analyzer/
46+
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
47+
48+
- name: Upload Workflow Artifacts
49+
uses: actions/upload-artifact@v1
50+
with:
51+
name: artifacts
52+
path: artifacts/

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ buildscript {
3030

3131
plugins {
3232
id 'java'
33-
id 'nebula.ospackage' version "8.0.1"
33+
id 'nebula.ospackage' version "8.2.0"
3434
}
3535

3636
ext {

0 commit comments

Comments
 (0)