首页 > 解决方案 > Git 签出到 Jenkins 中的子目录失败

问题描述

为我们的 Golang 项目开发 CI。

在 Windows master 上安装 Jenkins 后,我配置了第一个 Freestyle 项目。为了构建 golang 项目,项目代码必须在 GOPATH 下src。这是在我的情况里面C:\Windows\System32\config\systemprofile\go\

Source code management我对Jenkins内部的 Git Repository 选项进行了一些修改。我设置Check out to sub-directoryC:\Windows\System32\config\systemprofile\go\src\nhm所以 go 项目会被拉到 GOPATH 中。在我这样做之后,该git-fetch步骤开始失败。

错误是:

ERROR: Error cloning remote repo 'origin'
stderr: error: cannot spawn C:\Windows\System32\config\systemprofile\go\src\nhm@tmp\ssh3120648910683130753.bat: No such file or directory

Jenkins 目录没有改变(这包括 workspaceDir${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}和 buildsDir ${ITEM_ROOTDIR}/builds

我在这里想念什么?什么时候生成这个 .bat 文件,以便以后可以使用它来进行 git-clone?

标签: gitgojenkinsjenkins-plugins

解决方案


推荐阅读