windows - 无法使用来自 jenkins 的 git 从 tomcat 安装连接到 bitbucket

标签 windows git tomcat ssh jenkins

我安装了 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/

相关文章:

php - 无法链接到上一层的 index.html

Git 运行 Meld 作为 merge 工具失败 'check_requirements import gi'

spring - 如何通过apache tomcat初始化Spring容器

c++ - 如何在运行时更改 .exe 的名称

windows - Explorer.exe CPU 使用率随非 Explorer 进程增加?

windows - 将默认的 git 源添加到 visual studio?

git - 缺少 git 中提交的更改

git - git 决定不提交新添加文件的当前内容,而是提交添加时的内容,其背后的基本原理是什么?

angularjs - [Angular, Jersey]为什么我必须使用 jersey 在 $http 中指定应用程序名称

tomcat - Wildfly 中的全局初始化参数