我安装了 jenkins,将 jenkins.war 上传到我的 tomcat,在 Windows 中,并安装了 git 插件,我完成了 ssh key 的所有程序,我已经能够成功地推送和 pull 到我在 bitbucket 中的 git repo从 cmd,但我仍然无法从 jenkins 做到这一点,这是发生在我身上的奇怪事情:
我可以从 git batch 进行推 pull 和执行任何操作,但要从 cmd 执行相同的操作,我必须以管理员身份打开它。
eval 命令在 cmd 中不起作用。
我收到 jenkins git 插件安装 for windows 手册中提到的“返回状态代码 128:”异常,但我没有收到“致命:远程端意外挂断”错误,而是收到“E:\Tomcat 未被识别为内部或外部命令”
异常(exception)情况:
Fetching upstream changes from git@bitbucket.org:mycompany/myrepo.git
> C:\Program Files (x86)\Git\bin\git.exe --version # timeout=10
using GIT_SSH to set credentials SRVSYMPHONY SSH
> C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress git@bitbucket.org:mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*
FATAL: Failed to fetch from git@bitbucket.org:mycompany/myrepo.git
hudson.plugins.git.GitException: Failed to fetch from git@bitbucket.org:mycompany/myrepo.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:627)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:865)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:890)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1255)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
at hudson.model.Run.execute(Run.java:1740)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:233)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress git@bitbucket.org:mycompany/myrepo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: "E:\Tomcat" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
fatal: Could not read from remote repository.
你知道我发生了什么事吗?
谢谢
最佳答案
为了能够连接到我在 bitbicket 中的私有(private)仓库,我必须以这种方式将密码添加到 url:
https://<user>:<pass>@bitbucket.org/<user>/<project>.git
答案在这个问题中:
Using Jenkins with a private BitBucket Git repository
谢谢
关于windows - 无法使用来自 jenkins 的 git 从 tomcat 安装连接到 bitbucket,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25465477/