(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts publishOptions, repository string)
| 74 | } |
| 75 | |
| 76 | func runPublish(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts publishOptions, repository string) error { |
| 77 | if opts.assumeYes { |
| 78 | backendOptions.Options = append(backendOptions.Options, compose.WithPrompt(compose.AlwaysOkPrompt())) |
| 79 | } |
| 80 | |
| 81 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 82 | if err != nil { |
| 83 | return err |
| 84 | } |
| 85 | |
| 86 | project, metrics, err := opts.ToProject(ctx, dockerCli, backend, nil) |
| 87 | if err != nil { |
| 88 | return err |
| 89 | } |
| 90 | |
| 91 | if metrics.CountIncludesLocal > 0 { |
| 92 | return errors.New("cannot publish compose file with local includes") |
| 93 | } |
| 94 | |
| 95 | return backend.Publish(ctx, project, repository, api.PublishOptions{ |
| 96 | ResolveImageDigests: opts.resolveImageDigests || opts.app, |
| 97 | Application: opts.app, |
| 98 | OCIVersion: api.OCIVersion(opts.ociVersion), |
| 99 | WithEnvironment: opts.withEnvironment, |
| 100 | InsecureRegistry: opts.insecureRegistry, |
| 101 | }) |
| 102 | } |
no test coverage detected