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

`groovy.lang.MissingPropertyException: No such property: IMAGE_TAG for class: groovy.lang.Binding`

BeginnerTroubleshootingJenkinsfile syntax, Groovy & CPS errors
Answer

Likely causes → A variable referenced in Groovy that was never defined, a def variable declared in another script {} block (local scope), or an env var accessed without env..

Diagnose → Find where IMAGE_TAG should be set; check whether it was a def inside a different block.

Fix → Set env.IMAGE_TAG = ... and read env.IMAGE_TAG, or declare the variable above the pipeline {} block.

Prevent → Prefer env. for cross-stage values; avoid relying on undeclared binding variables.

All Jenkins questions Roadmap: Jenkins

More on Jenkinsfile syntax, Groovy & CPS errors