-
Notifications
You must be signed in to change notification settings - Fork 61
Fix manager pinned update source migration #41
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| set -Eeuo pipefail | ||
|
|
||
| DEFAULT_HOME="/opt/subboost" | ||
| DEFAULT_STABLE_RELEASE_URL="https://github.com/SubBoost/subboost/releases/latest/download/release.json" | ||
| SUBBOOST_HOME="${SUBBOOST_HOME:-$DEFAULT_HOME}" | ||
| ENV_FILE="$SUBBOOST_HOME/.env" | ||
| COMPOSE_FILE="$SUBBOOST_HOME/docker-compose.yml" | ||
|
|
@@ -138,6 +139,20 @@ write_runtime_env_value() { | |
| export "$key=$value" | ||
| } | ||
|
|
||
| is_official_fixed_release_url() { | ||
| case "1ドル" in | ||
| https://github.com/SubBoost/subboost/releases/download/v[0-9]*.[0-9]*.[0-9]*/release.json) return 0 ;; | ||
|
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. P2 Badge Constrain migration to exact stable tags For installations intentionally pinned to an official prerelease asset such as Useful? React with 👍 / 👎. |
||
| *) return 1 ;; | ||
| esac | ||
| } | ||
|
|
||
| migrate_update_release_url() { | ||
| local release_url="1ドル" | ||
| is_official_fixed_release_url "$release_url" || return 1 | ||
| say "Detected old fixed release update source; switching updates to stable latest." | ||
| write_runtime_env_value SUBBOOST_RELEASE_URL "$DEFAULT_STABLE_RELEASE_URL" | ||
| } | ||
|
|
||
| install_file_from_url() { | ||
| local url="1ドル" | ||
| local destination="2ドル" | ||
|
|
@@ -281,6 +296,9 @@ update_cmd() { | |
| local release_file="$TMP_DIR/release.json" | ||
| local image compose_url manager_url | ||
| mkdir -p "$TMP_DIR" | ||
| if migrate_update_release_url "$release_url"; then | ||
|
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. P2 Badge Avoid masking migration write failures When an old fixed official URL is detected but Useful? React with 👍 / 👎. |
||
| release_url="$DEFAULT_STABLE_RELEASE_URL" | ||
| fi | ||
| if [ -n "$release_url" ] && download_to_temp "$release_url" "$release_file" 2>/dev/null; then | ||
| image="$(json_get image "$release_file" || true)" | ||
| compose_url="$(resolve_url "$release_url" "$(json_get composeUrl "$release_file" || true)")" | ||
|
|
||