MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / localContainerCredentialCache

Function localContainerCredentialCache

cli/cmd/start/local.go:259–275  ·  view source on GitHub ↗
(docker common.Docker, dockerContainerName string, workspaceInfo workspace.WorkspaceInfo)

Source from the content-addressed store, hash-verified

257}
258
259func 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 对应的容器是否运行
278func isDockerComposeRunning(ctx context.Context, cli *client.Client, workingDir string, serviceNames []string) bool {

Callers 1

ExecuteStartCmdFunction · 0.85

Calls 3

InfoMethod · 0.80
ExecMethod · 0.80
DebugMethod · 0.80

Tested by

no test coverage detected