(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions)
| 36 | } |
| 37 | |
| 38 | func pushCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { |
| 39 | opts := pushOptions{ |
| 40 | ProjectOptions: p, |
| 41 | } |
| 42 | pushCmd := &cobra.Command{ |
| 43 | Use: "push [OPTIONS] [SERVICE...]", |
| 44 | Short: "Push service images", |
| 45 | RunE: Adapt(func(ctx context.Context, args []string) error { |
| 46 | return runPush(ctx, dockerCli, backendOptions, opts, args) |
| 47 | }), |
| 48 | ValidArgsFunction: completeServiceNames(dockerCli, p), |
| 49 | } |
| 50 | pushCmd.Flags().BoolVar(&opts.Ignorefailures, "ignore-push-failures", false, "Push what it can and ignores images with push failures") |
| 51 | pushCmd.Flags().BoolVar(&opts.IncludeDeps, "include-deps", false, "Also push images of services declared as dependencies") |
| 52 | pushCmd.Flags().BoolVarP(&opts.Quiet, "quiet", "q", false, "Push without printing progress information") |
| 53 | |
| 54 | return pushCmd |
| 55 | } |
| 56 | |
| 57 | func runPush(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts pushOptions, services []string) error { |
| 58 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
no test coverage detected