Interview Prep/Jenkins/Declarative pipeline syntax

What is the minimum valid declarative pipeline?

BeginnerConceptDeclarative pipeline syntax
Answer

A pipeline block with an agent, a stages block containing at least one stage, and each stage containing steps (or nested stages, parallel or matrix).

pipeline {
  agent any
  stages {
    stage('Build') {
      steps { sh 'echo hello' }
    }
  }
}

Missing agent fails with Missing required section "agent".

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax