Interview Prep/Jenkins/Scripted pipeline, Groovy & CPS

What is the `load` step and why do shared libraries replace it?

IntermediateConceptScripted pipeline, Groovy & CPS
Answer

load 'ci/helpers.groovy' evaluates a Groovy file from the workspace and returns its object, so you can call helpers.deploy(). It requires a workspace (an agent), is not versioned independently, cannot hold classes cleanly, and every repo copies the same file. Shared libraries are versioned, loaded before the pipeline starts, support classes and resources, and are reused across repos.

All Jenkins questions Roadmap: Jenkins

More on Scripted pipeline, Groovy & CPS