Interview Prep/Jenkins/Declarative pipeline syntax

When do you use `agent none` at the top level?

IntermediateConceptDeclarative pipeline syntax
Answer

When stages need different agents (Linux build, Windows test, deploy pod with a special service account) or when the pipeline has an input step that may wait for hours. With agent none, the approval stage holds no executor and no pod. The trade-off: each stage with its own agent gets a separate workspace, so pass files with stash/unstash or artifacts, or group stages under a parent stage that owns the agent.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax