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

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gaiksaya committed Jan 11, 2021
1 parent 19b8f9d commit f387cff
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Build and Release AD
on:
# push:
# tags:
# - v*
push:
tags:
- v*
branches:
- "release-workflow-patch"

jobs:
Build-AD:
Expand All @@ -20,8 +23,8 @@ jobs:
- name: Configure AWS
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-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Setup Java ${{ matrix.java }}
Expand All @@ -32,11 +35,26 @@ jobs:
- name: Run build
run: |
./gradlew buildPackages --console=plain -Dbuild.snapshot=false
artifact=`ls build/distributions/*.zip`
rpm_artifact=`ls build/distributions/*.rpm`
deb_artifact=`ls build/distributions/*.deb`
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-plugins/opendistro-anomaly-detection/
aws s3 cp $rpm_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/rpms/opendistro-anomaly-detection/
aws s3 cp $deb_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/debs/opendistro-anomaly-detection/
aws cloudfront create-invalidation --distribution-id E1VG5HMIWI4SA2 --paths "/downloads/*"
- name: Upload to S3
shell: bash
run: |
zip=`ls build/distributions/*.zip`
rpm=`ls build/distributions/*.rpm`
deb=`ls build/distributions/*.deb`
# Inject the build number before the suffix
zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm`
deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb`
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/anomaly-detection/"
echo "Copying ${zip} to ${s3_prefix}${zip_outfile}"
aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile}
echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}"
aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile}
echo "Copying ${deb} to ${s3_prefix}${deb_outfile}"
aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile}

0 comments on commit f387cff

Please sign in to comment.