First thing to note, it is good practice to not allocate a node for input, or it will hold that node until the timeout or until the input is processed.
Wrap your input in a timeout:
node {
stage('dev') {
build job: '11', propagate: false
}
stage('test') {
build job: '12', propagate: false
}
}
timeout(time: 60, unit: 'SECONDS') {
input 'Do you want to proceed to the Deployment?'
}
node {
stage('prod') {
build job: '13', propagate: false
}
}
You should see something like this in your output:
[Pipeline] // node
[Pipeline] timeout
Timeout set to expire in 1 min 0 sec
[Pipeline] {
Do you want to proceed to the Deployment?
Proceed or Abort
[Pipeline] input
An alternate solution would be to use the milestone plugin:
node {
stage('dev') {
build job: '11', propagate: false
}
stage('test') {
build job: '12', propagate: false
}
}
input 'Do you want to proceed to the Deployment?'
milestone 1
node {
stage('prod') {
build job: '13', propagate: false
}
}
Rather than timeout, this will wait for input indefinitely, but if another build runs and passes the milestone 1, then any previous builds that have not yet passed milestone 1 will be aborted.
Or you could wrap it all in a timeout to give useful flexibility to the input timeout.
timeout ( time: 24, unit: "HOURS" ) {
input 'Do you want to proceed to the Deployment?'
milestone 1
}