-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: separate the CDN upload process and add a retry script #563
Conversation
… npm publishing to complete
} | ||
|
||
# Retry 3 times with a 5-second delay in between | ||
retry 3 5 |
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.
I like this pattern - it's a nice way to work around the problem of the package not being instantly available.
I've made a few changes and ran them on my forked repo. @ethanWallace I added sleep timer (60 seconds) to allow time for npm to publish the web package before proceeding to publish the rest of the packages. Here's the log to see the publish package workflow run w/sleep timer ^ Above action also forces a failure so I can test the |
Co-authored-by: Pat Heard <patrick.heard@cds-snc.ca>
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.
LGTM!
Summary | Résumé
Refactor: separate the CDN upload process and add a retry to wait for npm publishing to complete
Fix for:
This adds a
retry
functionality to the part where the files get uploaded to the CDN. The script usually fails if the package is not yet available on NPM, especially if it's a new package.New Github workflow file
upload-cdn.yml
This separates the CDN upload part in a script called
upload_to_cdn.sh
, which runs on new the GitHub workflow fileupload-cdn.yml
.compile-and-publish.yml
workflow is completed.Tested with my scratch account at the moment
I ran our terraform files on my scratch account and linked our CDN to my custom domain.
Here are the links for quick testing, to make sure they do upload correctly:
Testing
@latest
and@0.22.1
are exactly the same:S3 Bucket
Confirmed: Contents are the same, file size is the same.