Interview Prep/Jenkins/Declarative pipeline syntax

What does `milestone` do?

AdvancedConceptDeclarative pipeline syntax
Answer

milestone(ordinal) ensures builds pass a point in order: when a newer build passes milestone N, older builds that have not yet reached N are aborted. Combined with input it prevents an old build from being approved and deploying over a newer one.

milestone(1)
input 'Deploy?'
milestone(2)

In declarative pipelines, disableConcurrentBuilds(abortPrevious: true) covers the common case more simply.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax