I've a Jenkins pipeline with following stage -

    stage('Test') {
                options {
                    timeout(time: 5, unit: 'MINUTES')
                }
                steps {
                    script {
                        //some code here
                    }
                }
            }

Here I've set timeout but there will be one parameter say `TimeoutEnabled`. 
If it has value `true`, only then use timeout restrictions otherwise there 
will be no timeout restriction for the stage.

How can I handle this efficiently without having duplicated code?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ee3e7588-dba4-41cf-8cec-2d331d0822d7o%40googlegroups.com.

Reply via email to