Interview Prep/Jenkins/Pipeline design & Jenkinsfile decisions

Your pipeline uses `stash` to move a 3 GB build output between stages on different agents and the controller struggles. What do you change?

IntermediateScenarioPipeline design & Jenkinsfile decisions
Answer

Situation read → Stashes are tarred through the controller and stored in JENKINS_HOME.

What I'd do →

  1. Keep stages that need the output on one agent (nested stages under one parent agent).
  2. If you must cross agents, push to an artifact store (Nexus raw repo, S3) and pull by build ID.
  3. Install Artifact Manager on S3 so stash and archive go directly from agent to S3.
  4. Stash only what is needed (includes: 'dist/**'), not the whole workspace.

Why → The controller is a scheduler, not a file server; large stashes cause heap and disk pressure.

Interview tip → Say "stash for kilobytes to a few MB, artifact store for anything big".

All Jenkins questions Roadmap: Jenkins

More on Pipeline design & Jenkinsfile decisions