Skip to content
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

display the location of OCI or GIT Compose stack download #12595

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

glours
Copy link
Contributor

@glours glours commented Mar 3, 2025

What I did
Display a message with the location where the OCI artifact or GIT Compose stack were downloaded

Related issue
https://docker.atlassian.net/browse/APCLI-881

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@glours glours requested a review from a team as a code owner March 3, 2025 10:00
@glours glours requested a review from ndeloof March 3, 2025 10:00
@glours glours self-assigned this Mar 3, 2025
@glours glours force-pushed the print-oci-artifact-location branch from 15cca45 to 278455b Compare March 3, 2025 10:18
@@ -116,6 +121,9 @@ func (g gitRemoteLoader) Load(ctx context.Context, path string) (string, error)
if stat.IsDir() {
local, err = findFile(cli.DefaultFileNames, local)
}
if progress.Mode != progress.ModeQuiet && progress.Mode != progress.ModeJSON {
_, _ = fmt.Fprintf(g.dockerCli.Out(), "Your compose stack %q is stored in %q\n", strings.TrimPrefix(path, prefix), local)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this message will print for every Git remote loaded by compose, including those involved by includes
Maybe better load project, then check if project.ComposeFiles[0] is remote then print result of Dir(".") as location where remote stack has been stored on disk

@glours glours force-pushed the print-oci-artifact-location branch from 278455b to e67d8b8 Compare March 3, 2025 18:14
func displayLocationRemoteStack(dockerCli command.Cli, project *types.Project, options buildOptions) {
mainComposeFile := options.ProjectOptions.ConfigPaths[0]
if ui.Mode != ui.ModeQuiet && ui.Mode != ui.ModeJSON {
if strings.HasPrefix(mainComposeFile, remote.OciPrefix) || strings.HasPrefix(mainComposeFile, "git://") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use remote.Accept as Git support has a bunch of corner cases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@glours glours force-pushed the print-oci-artifact-location branch from e67d8b8 to 684184c Compare March 3, 2025 19:02
@glours glours force-pushed the print-oci-artifact-location branch from 684184c to 7e8650a Compare March 3, 2025 20:00
@ndeloof ndeloof merged commit b6c8a2b into docker:main Mar 3, 2025
26 checks passed
@ndeloof ndeloof deleted the print-oci-artifact-location branch March 4, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants