(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, createOpts createOptions, buildOpts buildOptions, project *types.Project, services []string)
| 97 | } |
| 98 | |
| 99 | func runCreate(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, createOpts createOptions, buildOpts buildOptions, project *types.Project, services []string) error { |
| 100 | if err := createOpts.Apply(project); err != nil { |
| 101 | return err |
| 102 | } |
| 103 | |
| 104 | var build *api.BuildOptions |
| 105 | if !createOpts.noBuild { |
| 106 | bo, err := buildOpts.toAPIBuildOptions(services) |
| 107 | if err != nil { |
| 108 | return err |
| 109 | } |
| 110 | build = &bo |
| 111 | } |
| 112 | |
| 113 | if createOpts.AssumeYes { |
| 114 | backendOptions.Options = append(backendOptions.Options, compose.WithPrompt(compose.AlwaysOkPrompt())) |
| 115 | } |
| 116 | |
| 117 | backend, err := compose.NewComposeService(dockerCli, backendOptions.Options...) |
| 118 | if err != nil { |
| 119 | return err |
| 120 | } |
| 121 | return backend.Create(ctx, project, api.CreateOptions{ |
| 122 | Build: build, |
| 123 | Services: services, |
| 124 | RemoveOrphans: createOpts.removeOrphans, |
| 125 | IgnoreOrphans: createOpts.ignoreOrphans, |
| 126 | Recreate: createOpts.recreateStrategy(), |
| 127 | RecreateDependencies: createOpts.dependenciesRecreateStrategy(), |
| 128 | Inherit: !createOpts.noInherit, |
| 129 | Timeout: createOpts.GetTimeout(), |
| 130 | QuietPull: createOpts.quietPull, |
| 131 | }) |
| 132 | } |
| 133 | |
| 134 | func (opts createOptions) recreateStrategy() string { |
| 135 | if opts.noRecreate { |
no test coverage detected