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 36
Change CD workflow to use new staging bucket for artifacts #248
Closed
camerski
wants to merge
1
commit into
opendistro-for-elasticsearch:master
from
camerski:staging-artifacts
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -32,11 +32,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/snapshot/elasticsearch-plugins/anomaly-detection/" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So all plugins are uploading artifact to staging only in CD workflow ? Don't see production location in this file. Where will the production location be used ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The infrastructure team will promote artifacts to production as part of the ODFE release process. For out-of-cycle releases, you can promote the artifacts to production using your own workflows, or the infrastructure team can help. |
||
|
||
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} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GITHUB_RUN_NUMBER is unique number for each run, so the artifact name will be unique for each run, while the original artifact name keep the same for same version. Is this change compatible with current CD workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are making corresponding changes to how we generate ODFE distributions to handle the change to the naming convention. If you need to do an out-of-cycle release then there may be manual work required; the infrastructure team can help with that.