我安装了jenkins上传jenkins.war到我的tomcat,在windows中,并安装了git插件,我做了ssh键的所有程序,我已经能够成功推送到我的git repo in bitbucket从cmd,但我还没有能够从jenkins做到这一点,这里发生了一些奇怪的事情:
我可以从git批处理中执行推送和执行任务,但是为了能够从cmd执行相同操作,我必须以管理员身份打开它。
eval命令无法在cmd中运行。
我收到"返回状态码128:"在Windows手册的jenkins git插件安装中提到的异常,但不是得到"致命:远程端意外挂断"错误我得到" E:\ Tomcat未被识别为内部或外部命令"
这是例外:
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.
你知道发生在我身上的事吗?
由于
答案 0 :(得分:1)
为了能够在bitbucket中连接到我的私人仓库,我必须以这种方式将密码添加到URL:
https://<user>:<pass>@bitbucket.org/<user>/<project>.git
答案就是这个问题:
Using Jenkins with a private BitBucket Git repository
由于