What is the main benefit of enabling Lightweight checkout in a Jenkins Pipeline job?
Think about what Jenkins needs to start a Pipeline and what it fetches when lightweight checkout is enabled.
Lightweight checkout fetches only the Jenkinsfile instead of the whole repository. This saves time and resources when the full source code is not needed immediately.
Given a Jenkins Pipeline with lightweight checkout enabled, what will be the content of the workspace immediately after checkout?
Consider what lightweight checkout fetches compared to a full checkout.
With lightweight checkout, Jenkins fetches only the Jenkinsfile, so only that file is present in the workspace immediately after checkout.
Which snippet correctly enables lightweight checkout in a Jenkins Declarative Pipeline?
Look for the correct syntax to enable lightweight checkout in the checkout step.
Lightweight checkout is enabled by passing lightweightCheckout: true in the checkout step's SCM configuration.
A Jenkins Pipeline with lightweight checkout enabled fails with the error: "Lightweight checkout is not supported for this repository type". What is the most likely cause?
Think about what lightweight checkout requires from the Git server.
Lightweight checkout requires the Git server to support fetching single files via API. Some repository types or servers do not support this, causing the error.
In a Jenkins multibranch pipeline, what is the best practice regarding lightweight checkout to optimize build performance and reliability?
Consider when lightweight checkout helps and when it might cause problems.
Lightweight checkout improves performance by fetching only the Jenkinsfile, but if the Jenkinsfile depends on shared libraries or full repo context, it should be disabled to avoid failures.