Interview Prep/Jenkins/Shared libraries

What is the difference between a step and a global variable with properties?

IntermediateConceptShared libraries
Answer

A vars/ file without call() acts as a namespace object: vars/cfg.groovy with def registry() { 'docker.io/devopsshack' } is used as cfg.registry(). Global variables cannot hold state reliably between calls, because each access may get a new instance; do not use fields to store build data. Use env or return values instead.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries