-
Notifications
You must be signed in to change notification settings - Fork 15
Add a script to download the latest version. #134
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
Conversation
autarch
left a comment
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 think there's a simpler way to do this.
download_latest.sh
Outdated
|
|
||
| echo "Looks like you’re running $OS on $ARCH." | ||
|
|
||
| MANIFEST=$(wget -qO- "$RELEASE_URL") |
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.
The instructions tell people to use curl to fetch this script, but then it uses wget internally. I think it should curl since we know they already have that installed.
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.
But maybe this isn't needed at all.
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.
Switched to curl.
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 think this is more complex than it needs to be. Once you know the filename you want to download, you can download this: https://github.com/mongodb-labs/migration-verifier/releases/latest/download/$FILENAME
There's no need to hit the API and parse the response.
This does mean you need to calculate the filename directly instead of getting it from the API response, but it seems a lot simpler. You can see how I do this for ubi at https://github.com/houseabsolute/ubi/blob/master/bootstrap/bootstrap-ubi.sh
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’d rather not build in a dependency on the filename format.
OK to keep as-is?
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.
Sure, that's fine. But I'd note that we do control the filename!
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.
You know that & I know that, but the next maintainer may be a new hire or intern.
autarch
left a comment
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!
This facilitates use in CI.