Interview Prep/Jenkins/Jenkinsfile syntax, Groovy & CPS errors

`Unknown stage section "step". Starting with version 0.5, steps in a stage must be in a ‘steps’ block.`

BeginnerTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer

Likely causes → Typo step {} instead of steps {}, or steps written directly in the stage block.

Diagnose → The message includes line and column; open the Jenkinsfile there.

Fix →

stage('Build') { steps { sh 'make' } }

Prevent → Use the Declarative Directive Generator and an editor plugin with Jenkinsfile linting.

All Jenkins questions Roadmap: Jenkins

More on Jenkinsfile syntax, Groovy & CPS errors