(destPath string, srcPath string, useGitIgnore bool)
| 124 | } |
| 125 | |
| 126 | func (cr *containerReference) CopyDir(destPath string, srcPath string, useGitIgnore bool) common.Executor { |
| 127 | return common.NewPipelineExecutor( |
| 128 | common.NewInfoExecutor("%sdocker cp src=%s dst=%s", logPrefix, srcPath, destPath), |
| 129 | cr.copyDir(destPath, srcPath, useGitIgnore), |
| 130 | func(ctx context.Context) error { |
| 131 | // If this fails, then folders have wrong permissions on non root container |
| 132 | if cr.UID != 0 || cr.GID != 0 { |
| 133 | _ = cr.Exec([]string{"chown", "-R", fmt.Sprintf("%d:%d", cr.UID, cr.GID), destPath}, nil, "0", "")(ctx) |
| 134 | } |
| 135 | return nil |
| 136 | }, |
| 137 | ).IfNot(common.Dryrun) |
| 138 | } |
| 139 | |
| 140 | func (cr *containerReference) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error) { |
| 141 | if common.Dryrun(ctx) { |
nothing calls this directly
no test coverage detected