(docker common.Docker, dockerContainerName string, workspaceInfo workspace.WorkspaceInfo)
| 257 | } |
| 258 | |
| 259 | func localContainerCredentialCache(docker common.Docker, dockerContainerName string, workspaceInfo workspace.WorkspaceInfo) { |
| 260 | |
| 261 | if workspaceInfo.GitRepoAuthType != workspace.GitRepoAuthType_Basic { |
| 262 | return |
| 263 | } |
| 264 | |
| 265 | common.SmartIDELog.Info("容器缓存git 用户名、密码") |
| 266 | command := fmt.Sprintf(`git config --global user.name "%v" && git config --global user.password "%v" && git config --global credential.helper store`, |
| 267 | workspaceInfo.GitUserName, workspaceInfo.GitPassword) |
| 268 | |
| 269 | out, err := docker.Exec(context.Background(), dockerContainerName, "/usr/bin -c", strings.Split(command, " "), []string{}) |
| 270 | common.CheckError(err) |
| 271 | common.SmartIDELog.Debug(out) |
| 272 | |
| 273 | common.SmartIDELog.Debug(out) |
| 274 | |
| 275 | } |
| 276 | |
| 277 | // docker-compose 对应的容器是否运行 |
| 278 | func isDockerComposeRunning(ctx context.Context, cli *client.Client, workingDir string, serviceNames []string) bool { |
no test coverage detected