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 →
- Keep stages that need the output on one agent (nested stages under one parent
agent). - If you must cross agents, push to an artifact store (Nexus raw repo, S3) and pull by build ID.
- Install Artifact Manager on S3 so stash and archive go directly from agent to S3.
- 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".
More on Pipeline design & Jenkinsfile decisions
A team's PR builds pile up: every push to an open PR starts a new 25-minute build while the old one keeps running. What do you change?BeginnerA deploy pipeline waits on `input` for approval, and on Monday you find 14 pods sitting idle since Friday. Fix it.IntermediateUnit tests, lint, dependency audit and SAST run sequentially and take 22 minutes. How do you restructure the pipeline?BeginnerDevelopers want to rerun only the deploy stage when it fails due to a flaky cluster API, without rebuilding the image. What do you offer?IntermediateA pipeline must run integration tests against a shared staging database that can only handle one test run at a time across four different repos. How do you coordinate?IntermediateA library must be tested on Node 18, 20 and 22, on Linux and Windows, but Node 18 on Windows is not supported. Design the stage.Intermediate