-
Notifications
You must be signed in to change notification settings - Fork 846
install: Default to staging repo file for staging download URL #480
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
|
@thaJeztah PTAL |
thaJeztah
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.
Left a comment (at least the tab <--> spaces should be fixed 😄 )
install.sh
Outdated
| DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo" | ||
|
|
||
| if [ -z "$REPO_FILE" ]; then | ||
| REPO_FILE="$DEFAULT_REPO_FILE" | ||
| # Automatically default to a staging repo fora | ||
| # a staging download url (download-stage.docker.com) | ||
| case "$DOWNLOAD_URL" in | ||
| *-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";; | ||
| esac |
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.
Looks like the new lines accidentally used spaces for indentation (I thought we had shfmt running in this repo, but looks like we don't? (we should add it).
| DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo" | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo fora | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";; | |
| esac | |
| DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo" | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo for | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";; | |
| esac |
One thing I was looking at, but we already have some cases where we did, was to keep "internal" vars lowercase, so that it's slightly more clear which env-vars we expect users to be using for overrides. (We can't use local because that's not a POSIX thing).
| DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo" | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo fora | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";; | |
| esac | |
| default_staging_repo_file="docker-ce-staging.repo" | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo for | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="$default_staging_repo_file";; | |
| esac |
Or ... we could keep it simple, because we don't use that var anywhere else;
| DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo" | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo fora | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";; | |
| esac | |
| if [ -z "$REPO_FILE" ]; then | |
| REPO_FILE="$DEFAULT_REPO_FILE" | |
| # Automatically default to a staging repo for | |
| # a staging download url (download-stage.docker.com) | |
| case "$DOWNLOAD_URL" in | |
| *-stage*) REPO_FILE="docker-ce-staging.repo";; | |
| esac |
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.
OH! There's a typo as well (fora -> for)
When using a staging download URL (containing "-stage" in the URL), and no explicit repo was provided automatically use the staging repo file as well. So it's sufficient to do: ``` curl -L get.docker.com | DOWNLOAD_URL="https://download-stage.docker.com" sh - ``` instead of ``` curl -L get.docker.com | REPO_FILE="docker-ce-staging.repo" DOWNLOAD_URL="https://download-stage.docker.com" sh - ``` Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
thaJeztah
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
When using a staging download URL (containing "-stage" in the URL), and no explicit repo was provided automatically use the staging repo file as well.
(This only affects DNF distros)
So it's sufficient to do:
instead of
Signed-off-by: Paweł Gronowski pawel.gronowski@docker.com