What if your builds could skip the heavy lifting and finish in a flash?
Why Lightweight checkout in Jenkins? - Purpose & Use Cases
Imagine you have a big project stored in a code repository. Every time Jenkins runs a build, it downloads the entire project, even if only a small part changed.
This full download takes a lot of time and uses unnecessary space. It slows down your builds and wastes resources, especially when you only need a few files.
Lightweight checkout lets Jenkins grab just the files it needs to run the build. This saves time and space by avoiding the full project download.
checkout scm
checkout([$class: 'GitSCM', extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, timeout: 10, lightweight: true]], ...])
It enables faster, more efficient builds by only fetching essential files from the repository.
For example, a Jenkins job that runs tests only on changed files can use lightweight checkout to speed up the process and get results quicker.
Full checkouts download everything, causing delays.
Lightweight checkout fetches only needed files.
This makes builds faster and saves resources.