How can I set the job timeout using the Jenkins DSL

pwan

How can I use the Jenkins DSL to set the job timeout to 10 minutes ?

From http://job-dsl.herokuapp.com/, I can enter

job {
  name 'ci'
  description 'Build and test the app.'
  wrappers {    
     timeout()
   }
}

and it generates the following block for the timeout, with a default of 3 minutes.

<buildWrappers>
    <hudson.plugins.build__timeout.BuildTimeoutWrapper>
        <strategy class='hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy'>
            <timeoutMinutes>3</timeoutMinutes>
        </strategy>
        <operationList></operationList>
    </hudson.plugins.build__timeout.BuildTimeoutWrapper>
</buildWrappers>

What do I need to enter as the 'timeoutClosure' to get the DSL to generate

<timeoutMinutes>10</timeoutMinutes>

instead ?

Christopher Orr

The Job DSL reference says that timeout takes a closure with absolute() for this case:

job {
  wrappers {
    timeout {
      absolute(minutes = 10)
    }
  }
}

You can omit the minutes = prefix, but I find it's better to leave it explicit as to what the unit of time is.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I set the job timeout for all jobs using the Jenkins DSL

From Dev

How can I delete a job using Job DSL plugin(script) in Jenkins?

From Dev

How can I set the secret token for gitlab plugin with Jenkins job dsl?

From Dev

How to specify Job DSL checkout timeout in Jenkins Git plugin?

From Dev

using classes in jenkins job dsl

From Dev

How can i update a jenkins job using the api

From Dev

How can I create parameterized Jenkins job?

From Dev

How can I create parameterized Jenkins job?

From Dev

How to add upstream job in Jenkins DSL

From Dev

Using Jenkins Job DSL to set "Polling ignores commits in certain paths" for Git plugin

From Dev

How can I set a timeout on "return false"?

From Dev

How do I make a job mutually exclusive with a set of jobs in Jenkins?

From Dev

Jenkins DSL Plugin: How to create a job in an existing jenkins View?

From Dev

How can I get the seed job's name inside a Jenksin Job DSL script?

From Dev

How can I ensure that only one if a kind of Jenkins job is run?

From Dev

Jenkins: How can I populate parameters from database to parameterized job?

From Dev

How can I ensure that only one if a kind of Jenkins job is run?

From Dev

How can I set the jenkins authentication token?

From Dev

How can I set a concurrency "weight" in Jenkins?

From Dev

Create a list view in a subfolder using the job DSL plugin in Jenkins

From Dev

gradle test fail when using slackNotifier in Jenkins Job DSL definition

From Dev

Downloading dependencies using grape with Jenkins Job DSL plugin error

From Dev

How do i set the requestPayloadType parameter to a HashMap using Java DSL

From Dev

How to use closures of Jenkins Job DSL Plugin within groovy classes

From Dev

How can I know how long a Jenkins job has been in the wait queue after the job is finished?

From Dev

Push a tag with Jenkins Job DSL

From Dev

Add dependency to jenkins job dsl

From Dev

How can I ask jenkins to execute one job before another job?

From Dev

How can I set a timeout for a zmq request in Node.js?

Related Related

  1. 1

    How can I set the job timeout for all jobs using the Jenkins DSL

  2. 2

    How can I delete a job using Job DSL plugin(script) in Jenkins?

  3. 3

    How can I set the secret token for gitlab plugin with Jenkins job dsl?

  4. 4

    How to specify Job DSL checkout timeout in Jenkins Git plugin?

  5. 5

    using classes in jenkins job dsl

  6. 6

    How can i update a jenkins job using the api

  7. 7

    How can I create parameterized Jenkins job?

  8. 8

    How can I create parameterized Jenkins job?

  9. 9

    How to add upstream job in Jenkins DSL

  10. 10

    Using Jenkins Job DSL to set "Polling ignores commits in certain paths" for Git plugin

  11. 11

    How can I set a timeout on "return false"?

  12. 12

    How do I make a job mutually exclusive with a set of jobs in Jenkins?

  13. 13

    Jenkins DSL Plugin: How to create a job in an existing jenkins View?

  14. 14

    How can I get the seed job's name inside a Jenksin Job DSL script?

  15. 15

    How can I ensure that only one if a kind of Jenkins job is run?

  16. 16

    Jenkins: How can I populate parameters from database to parameterized job?

  17. 17

    How can I ensure that only one if a kind of Jenkins job is run?

  18. 18

    How can I set the jenkins authentication token?

  19. 19

    How can I set a concurrency "weight" in Jenkins?

  20. 20

    Create a list view in a subfolder using the job DSL plugin in Jenkins

  21. 21

    gradle test fail when using slackNotifier in Jenkins Job DSL definition

  22. 22

    Downloading dependencies using grape with Jenkins Job DSL plugin error

  23. 23

    How do i set the requestPayloadType parameter to a HashMap using Java DSL

  24. 24

    How to use closures of Jenkins Job DSL Plugin within groovy classes

  25. 25

    How can I know how long a Jenkins job has been in the wait queue after the job is finished?

  26. 26

    Push a tag with Jenkins Job DSL

  27. 27

    Add dependency to jenkins job dsl

  28. 28

    How can I ask jenkins to execute one job before another job?

  29. 29

    How can I set a timeout for a zmq request in Node.js?

HotTag

Archive