使用 Hudson 配置 GIT

发布于 2024-12-04 05:59:42 字数 2664 浏览 1 评论 0原文

我对 HUDSON 和 GIT 很天真,我遵循了一些教程并尝试配置 hudson 和 git。

到目前为止我已经完成的设置,

  1. 设置 git 可执行文件的路径
  2. 使用 mysysgit UI 创建了一个空的本地存储库。
  3. 创建一个新的工作,用git作为源代码管理,
    • 存储库 URL:file:///c:/GitShare/Test/MyRepo
    • 分支说明符:master
  4. 保存文件并运行构建

我得到以下内容错误:

Started by user anonymous
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Using strategy: Default
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Fetching changes from the remote Git repository
Fetching upstream changes from file:///c:/GitShare/Test/MyRepo
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: C:\Git\bin fetch -t file:///c:/GitShare/Test/MyRepo +refs/heads/*:refs/remotes/origin/*
Cannot run program "C:\Git\bin" (in directory "C:\Hudson\jobs\Test1\workspace"): CreateProcess error=5, Access is denied
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:824)
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:782)
    at hudson.FilePath.act(FilePath.java:758)
    at hudson.FilePath.act(FilePath.java:740)
    at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:782)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:568)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
    at hudson.model.Run.run(Run.java:1367)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)

更新

感谢您的回复,我已经向用户授予了所有权限,并指定了路径,即“C:\Git\bin\git.exe”..在解决之后我能够通过以下方式连接到本地存储库Hudson,但是当我尝试连接到另一个本地存储库时,出现以下错误。

由用户匿名发起 签出:工作区 / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0 使用策略:默认 签出:工作区 / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0 从远程 Git 存储库获取更改 从 git://160.110.149.132/GIT_Repo 获取上游更改 错误:无事可做 [DEBUG] 跳过构建的监视依赖项更新:Job1 #3,因为结果:失败 已完成:失败

我猜存储库未正确初始化,您能否告诉我创建本地存储库并公开发布它的步骤。

我创建存储库时遵循的步骤: 1.打开Git Bash Shell, 2.导航到要发布项目的repo文件夹,然后输入“git init”命令。

问题 2:

如果我的存储库位于“c:/GitShare/Repo”。 此“Repo”文件夹包含“.git”和项目(待发布)文件夹。

那么存储库的 URL 是什么?

I am naive to HUDSON and GIT, i followed some tutorials and tried to configure hudson and git.

Settings that i have done till now,

  1. Set the path to git executable
  2. created a empty local repository using mysysgit UI.
  3. create a new job with git as source code management,
    • URL of Repository: file:///c:/GitShare/Test/MyRepo
    • Branch Specifier : master
  4. save the file and run the build

I got the following error:

Started by user anonymous
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Using strategy: Default
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Fetching changes from the remote Git repository
Fetching upstream changes from file:///c:/GitShare/Test/MyRepo
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: C:\Git\bin fetch -t file:///c:/GitShare/Test/MyRepo +refs/heads/*:refs/remotes/origin/*
Cannot run program "C:\Git\bin" (in directory "C:\Hudson\jobs\Test1\workspace"): CreateProcess error=5, Access is denied
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:824)
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:782)
    at hudson.FilePath.act(FilePath.java:758)
    at hudson.FilePath.act(FilePath.java:740)
    at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:782)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:568)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
    at hudson.model.Run.run(Run.java:1367)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)

UPDATE

thanks for replying, i had already given all the permission to user, and had specified the path i.e. "C:\Git\bin\git.exe".. after working around i am able to connect to a local repository through Hudson but when i tried to connect to another local repository i am getting the following error.

Started by user anonymous
Checkout:workspace / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0
Using strategy: Default
Checkout:workspace / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0
Fetching changes from the remote Git repository
Fetching upstream changes from git://160.110.149.132/GIT_Repo
ERROR: Nothing to do
[DEBUG] Skipping watched dependency update for build: Job1 #3 due to result: FAILURE
Finished: FAILURE

I guess repository is not initialized properly, can you please tell me the steps to create local repository and to publish it publicly.

Steps i have followed to create a repository:
1. open Git Bash Shell,
2. navigate to the repo folder which is having project to be published, and typed "git init" command.

Question 2:

if my repository is located on "c:/GitShare/Repo".
This "Repo" folder contains a ".git" and Project(to be published) folders.

Than what will be URL for the repository?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愿得七秒忆 2024-12-11 05:59:42

您确定您的路径和权限设置正确吗?

  • 当询问 git 可执行文件的路径时,Hudson 可能希望您指定包含 .exe 文件名的完整路径,而不仅仅是 C:/Git/bin (这只是它所在的文件夹) 。
  • 或者,无论 Hudson 正在运行什么用户,都可能无权访问该目录。

Are you sure that you have your paths and permissions set correctly?

  • When asked for the path to the git executable, Hudson may want you to specify a full path including the .exe filename, and not just C:/Git/bin (which is just the folder it's in).
  • Alternatively, whatever user Hudson is running as may not have access to that directory.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文