gpt4 book ai didi

git - Jenkins - 无法在子模块路径 'submodule-project' 中找到当前的原始/开发版本

转载 作者:行者123 更新时间:2023-12-05 07:41:17 29 4
gpt4 key购买 nike

我有一个 Jenkins 作业,它 pull 一个带有包含在 .gitsubmodule 文件中的子模块的 git 仓库。我第一次提取 repo 时没有问题,但是在我将一些更改推送到子模块后,Jenkins 不再提取更新的子模块 repo。它只会 pull 在主仓库中所做的更改。

所以我尝试启用“将跟踪子模块更新到分支尖端”选项: enter image description here

但是我得到以下错误:

 > /usr/bin/git submodule update --init --recursive --remote submodule-project
FATAL: Command "/usr/bin/git submodule update --init --recursive --remote submodule-project" returned status code 1:
stdout:
stderr: fatal: Needed a single revision
Unable to find current origin/dev revision in submodule path 'submodule-project'

hudson.plugins.git.GitException: Command "/usr/bin/git submodule update --init --recursive --remote submodule-project" returned status code 1:
stdout:
stderr: fatal: Needed a single revision
Unable to find current origin/dev revision in submodule path 'submodule-project'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1097)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:120)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at ......remote call to IS-MEAN_Slave(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
at hudson.remoting.Channel.call(Channel.java:781)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor442.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
at com.sun.proxy.$Proxy65.execute(Unknown Source)
at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:107)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1188)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

我的 .gitmodule 文件如下所示:

[submodule "submodule-project"]
path = submodule-project
url = <path-to-submodule-project>.git
branch = dev

知道如何解决这个问题吗?

注意:我找不到很多关于 .gitmodules 文件语法的引用资料,但我认为我正确地使用了 branch 选项。有错误请指出。

最佳答案

我认为您必须提供在子模块更新期间使用的引用仓库路径。

关于git - Jenkins - 无法在子模块路径 'submodule-project' 中找到当前的原始/开发版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45439981/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com