How to add a timeout step to Jenkins Pipeline
You can use the timeout step: timeout(20) { node { sh ‘foo’ } } If you need a different TimeUnit than MINUTES, you can supply the unit argument: timeout(time: 20, unit: ‘SECONDS’) { EDIT Aug 2018: Nowadays with the more common declarative pipelines (easily recognized by the top-level pipeline construct), timeouts can also be specified … Read more