A. The node block is incorrectly placed inside stage
B. Missing agent inside the stage block
C. The steps block should be outside node
D. The echo command is invalid inside steps
Solution
Step 1: Review pipeline block structure
Declarative pipelines require agent to specify where stages run; node is not valid inside stage in declarative syntax.
Step 2: Identify correct usage
Instead of node, the stage should have an agent block or rely on global agent any.
Final Answer:
The node block is incorrectly placed inside stage -> Option A
Quick Check:
Declarative stage needs agent, not node [OK]
Hint: Use agent, not node, inside declarative stage blocks [OK]
Common Mistakes:
Using node block inside declarative stage
Confusing steps placement
Thinking echo is invalid inside steps
5. You want to run two stages in your Jenkins pipeline: 'Build' on a Linux node and 'Test' on a Windows node. Which pipeline snippet correctly uses node and stage blocks to achieve this?