-
Improvement
-
Resolution: Duplicate
-
Minor
When using a Multibranch Pipeline job type, the Jenkinsfile in the SCM repository branch being built contains the statement checkout scm. But if the Git repository contains submodules, they are not initialized or updated in the Jenkins build workspace.
Typically submodule initialization/updating is automatically handled by the Git SCM for Jenkins Freestyle jobs.
Workaround
You can call the git executable manually from the Jenkinsfile pipeline DSL, like this:
checkout scm bat 'git submodule update --init' // or sh
- duplicates
-
JENKINS-31924 GitSCMSource should offer extensions
-
- Closed
-
[JENKINS-32658] Multibranch pipeline 'checkout scm' does not handle Git submodules
Description |
Original:
When using a Multibranch Pipeline job type, the Jenkinsfile in the SCM repository branch being built contains the statement {{checkout scm}}. But if the Git repository contains submodules, they are not initialized or updated in the Jenkins build workspace. Typically submodule initialization/updating is automatically handled by the Git SCM for Jenkins Freestyle jobs. h4. Workaround You can call the {{git}} executable manually from the Jenkinsfile pipeline DSL, like this: {noformat} checkout scm execute 'git submodule update --init' {noformat} |
New:
When using a Multibranch Pipeline job type, the Jenkinsfile in the SCM repository branch being built contains the statement {{checkout scm}}. But if the Git repository contains submodules, they are not initialized or updated in the Jenkins build workspace. Typically submodule initialization/updating is automatically handled by the Git SCM for Jenkins Freestyle jobs. h4. Workaround You can call the {{git}} executable manually from the Jenkinsfile pipeline DSL, like this: {noformat} checkout scm bat 'git submodule update --init' // or sh {noformat} |
Issue Type | Original: Bug [ 1 ] | New: Improvement [ 4 ] |
Link |
New:
This issue duplicates |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 168317 ] | New: JNJira + In-Review [ 198396 ] |
Comment |
[ [~jglick] how to set the extension config on scm? There is no function in GitSCM class to set the extensions except with the constructor. I can create a custom checkout(...) call. but than it makes no sense in a multibranch project with Jenkinsfiles. ] |
Component/s | New: pipeline-general [ 21692 ] |
Component/s | Original: workflow-plugin [ 18820 ] |
I think you would need to configure the SCM source to include the submodule extension.