Jenkins Git plugin is not fetching commits in submodules

552 Views Asked by At

I have a Git repository abc.git containing submodules in it. We have a Jenkins job that is used to build abc.git repository.

The Jenkins job uses the GitSCM plugin to check out the code and do the build. Below is the plugin configuration that is used in the job.

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

When I do a commit in the ABC repository that commit is reflected in the Jenkins build changelog set. But when I do a commit in the submodules the commit is not getting shown in the Jenkins build changelog set.

Please let me know if there is any other configuration that needs to be added to the plugin configuration to make this work.

Also, let me know if there is an alternative way to solve this if the plugin does not support it.

1

There are 1 best solutions below

0
On

But when I do a commit in the submodules the commit is not getting shown in the Jenkins build changelog set.

Two possible reasons:

You did a commit in the submodule, but

  • did not push to the remote submodule
  • and/or did not commit as well in the parent repository (in order to record the new submodule root tree SHA1)

You would see in the Jenkins changelog set the parent repository commit SHA1, recording the change of the submodule.
You would not see the submodule internal commit.