【问题标题】:Jenkins Git plugin is not fetching commits in submodulesJenkins Git 插件未获取子模块中的提交
【发布时间】:2021-10-23 00:55:00
【问题描述】:

我有一个 Git 存储库 abc.git,其中包含子模块。我们有一个 Jenkins 作业,用于构建 abc.git 存储库。

Jenkins 作业使用 GitSCM 插件检查代码并进行构建。以下是作业中使用的插件配置。

 checkout([$class: 'GitSCM', changelog: true, branches: [[name: "*/${branch}"]], 
                  extensions: [[$class: 'SubmoduleOption', disableSubmodules: false,
                  parentCredentials: false, recursiveSubmodules: true, reference: '',
                  trackingSubmodules: true]], 
                  userRemoteConfigs:[[credentialsId: '', 
                  url: "${componentUrl}"]]])

当我在 ABC 存储库中进行提交时,该提交反映在 Jenkins 构建更改日志集中。但是当我在子模块中进行提交时,Jenkins 构建更改日志集中没有显示提交。

如果需要将任何其他配置添加到插件配置中以使其工作,请告诉我。

另外,如果插件不支持,请告诉我是否有其他方法可以解决此问题。

【问题讨论】:

    标签: jenkins-pipeline git-submodules git-commit jenkins-git-plugin


    【解决方案1】:

    但是当我在子模块中进行提交时,该提交没有显示在 Jenkins 构建更改日志集中。

    两个可能的原因:

    你在子模块中做了一个提交,但是

    • 没有推送到远程子模块
    • 和/或没有在父存储库中提交(为了记录新的子模块根树 SHA1)

    您会在 Jenkins 更改日志中看到设置父存储库提交 SHA1,记录子模块的更改。
    您不会看到子模块内部提交。

    【讨论】:

      猜你喜欢
      • 2012-04-20
      • 2012-06-06
      • 1970-01-01
      • 1970-01-01
      • 2021-10-15
      • 1970-01-01
      • 2017-04-11
      • 2012-09-13
      • 2013-01-03
      相关资源
      最近更新 更多