简体   繁体   English

Jenkins-无法在子模块路径“ submodule-project”中找到当前的原始版本/ dev版本

[英]Jenkins - Unable to find current origin/dev revision in submodule path 'submodule-project'

I have a Jenkins job that pulls a git repo with submodule included in .gitsubmodule file. 我有一个詹金斯(Jenkins)工作,它使用.gitsubmodule文件中包含的子模块提取git repo。 The first time that I pulled the repo, there was no issue, but after I have pushed some changes to the submodule, Jenkins no longer pulls the updated submodule repo. 第一次提取存储库没有问题,但是在对子模块进行了一些更改之后,Jenkins不再提取更新的子模块存储库。 It only pulls the changes made in the main repo. 它只提取主仓库中所做的更改。

So I have tried enabling the "Update tracking submodules to tip of branch" option: 因此,我尝试启用“将跟踪子模块更新到分支的尖端”选项: 在此处输入图片说明

But I get the following error: 但是我收到以下错误:

 > /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

My . 我的 gitmodule file looks like this: gitmodule文件如下所示:

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

Any idea how to resolve this? 任何想法如何解决这个问题?

Note: I could not find many references for syntax of .gitmodules file, but I think I am using branch option correctly. 注意:我找不到.gitmodules文件语法的许多参考,但是我认为我正确使用了branch选项。 Please point out for any mistakes. 请指出任何错误。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM