-
Notifications
You must be signed in to change notification settings - Fork 103
Fix release installer tag defaults #38
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 |
|---|---|---|
|
|
@@ -175,10 +175,27 @@ function replaceInstallerDefault(content, item, replacement) { | |
| return content.replace(expected, replacementLine); | ||
| } | ||
|
|
||
| function withInferredInstallerDefaults(args) { | ||
| const inferred = { ...args }; | ||
| const releaseAssetBaseUrl = args.baseUrl || ""; | ||
| const releaseImageTag = | ||
| args.imageTag || (args.releaseTag ? `${args.imageRepository || DEFAULT_IMAGE_REPOSITORY}:${args.releaseTag}` : ""); | ||
|
|
||
| if (releaseAssetBaseUrl) { | ||
| inferred.installerReleaseUrl = inferred.installerReleaseUrl || urlJoin(releaseAssetBaseUrl, "release.json"); | ||
|
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.
When the generated installer is downloaded through the normal Useful? React with 👍 / 👎. |
||
| inferred.installerComposeUrl = | ||
| inferred.installerComposeUrl || urlJoin(releaseAssetBaseUrl, "docker-compose.image.yml"); | ||
| inferred.installerManagerUrl = inferred.installerManagerUrl || urlJoin(releaseAssetBaseUrl, MANAGER_ASSET_NAME); | ||
| } | ||
| if (releaseAssetBaseUrl && releaseImageTag) inferred.installerImage = inferred.installerImage || releaseImageTag; | ||
| return inferred; | ||
| } | ||
|
|
||
| function rewriteInstallerDefaults(content, args) { | ||
| const resolvedArgs = withInferredInstallerDefaults(args); | ||
| let output = content; | ||
| for (const item of INSTALLER_DEFAULTS) { | ||
| const replacement = args[item.key]; | ||
| const replacement = resolvedArgs[item.key]; | ||
| if (replacement) output = replaceInstallerDefault(output, item, replacement); | ||
| } | ||
| return output; | ||
|
|
||
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.
For release builds that pass an exact
--imagevalue but omit--image-tag,buildManifest()writes that exact image torelease.json, while this inference buildsDEFAULT_IMAGEfrom the repository/tag fallback instead. If the installer cannot fetchrelease.jsonand has to useDEFAULT_IMAGE, it can installghcr.io/subboost/subboost:<tag>rather than the image actually published for that release. Derive the fallback fromargs.image || args.imageTag || ..., or require--image-tagwhenever--imageis supplied.Useful? React with 👍 / 👎.