I'm currently trying to realize job timeouts, etc vi "wrappers" as described in the docs and some examples.
Regardless whether I apply wrappers directly on jobs or on job templates or defaults, I can't see any effect on the generated XML.
There is some bug report from a couple of years ago but despite it sounds quite similar I think the solution does not apply for me since the report is Jenkins specific but my generated config does not contain a <buildWrappers> section at all!
For example the following YAML should generate a timeout section:
- job:
name: bla
project-type: "pipeline"
dsl: |
sh("hello world")
wrappers:
- timeout:
timeout-var: 'BUILD_TIMEOUT'
fail: true
elastic-percentage: 150
elastic-default-timeout: 90
type: elastic
Generated output:
<?xml version="1.0" encoding="utf-8"?>
<flow-definition plugin="workflow-job">
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps">
<script>sh("hello world")
</script>
<sandbox>false</sandbox>
</definition>
<actions/>
<description><!-- Managed by Jenkins Job Builder --></description>
<keepDependencies>false</keepDependencies>
<properties>
<org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty/>
</properties>
</flow-definition>
Any idea what I'm doing wrong here?
I'm using jenkins-job-builder v3.12.0 on Python 3.9
Ok, found it
Looks like the documentation just didn't mention that wrappers don't work for the only job type I'm using :)