If we're using Pipeline Script from SCM with p4-plugin, in most cases we'll have two SCM checkouts performed: one for script, the other in "Declarative: Checkout SCM" stage. The first one could utilize lightweight checkout, so it checks out only Pipeline script thus making the build faster.
Currently it's not supported:
Lightweight checkout support not available, falling back to full checkout.
[JENKINS-46269] p4-plugin: Implement lightweight checkout of file from perforce repo
Description | Original: If we're using Pipeline Script from SCM with p4-plugin, in most cases we'll have two SCM checkouts performed: one for script, the other in "Declarative: Checkout SCM" stage. The first one could utilize lightweight checkout, so it checks out only Pipeline script thus making the build faster. |
New:
If we're using Pipeline Script from SCM with p4-plugin, in most cases we'll have two SCM checkouts performed: one for script, the other in "Declarative: Checkout SCM" stage. The first one could utilize lightweight checkout, so it checks out only Pipeline script thus making the build faster. Currently it's not supported: {{Lightweight checkout support not available, falling back to full checkout.}} |
Priority | Original: Major [ 3 ] | New: Blocker [ 1 ] |
Assignee | New: Remik Pi [ p4 ] |
Assignee | Original: Remik Pi [ p4 ] |
Assignee | New: Paul Allen [ p4paul ] |
Priority | Original: Blocker [ 1 ] | New: Major [ 3 ] |
Also all commits are added to currentBuild.changeSets with the full checkout fallback, which ends up with all commits showing up twice in currentBuild.changeSets, for which there is no workaround in a sandboxed Jenkinsfile script.
Not doing the checkout step in the script will result in not getting the P4_CHANGELIST and other environment variables which the Jenkinsfile relies on.
I did find a workaround by using:
checkout changelog: false, scm:perforce( ... )