add retry-count in general.py
implement retry-coutn in general.py; update doc and add test fixtures Change-Id: Ifeb4fb645ad0e4bc12d41ef4481aca1888a4041a
This commit is contained in:
parent
72c02d4106
commit
c9c784aecc
@ -24,6 +24,7 @@ later. There are a few basic optional fields for a Job definition::
|
||||
quiet-period: 5
|
||||
block-downstream: false
|
||||
block-upstream: false
|
||||
retry-count: 3
|
||||
|
||||
:Job Parameters:
|
||||
* **project-type**:
|
||||
@ -76,5 +77,9 @@ later. There are a few basic optional fields for a Job definition::
|
||||
triggered by accessing a special predefined URL. Only those who
|
||||
know the token will be able to trigger builds remotely.
|
||||
|
||||
* **retry-count**:
|
||||
If a build fails to checkout from the repository, Jenkins will
|
||||
retry the specified number of times before giving up.
|
||||
|
||||
.. automodule:: general
|
||||
:members:
|
||||
|
@ -99,6 +99,10 @@ class General(jenkins_jobs.modules.base.Base):
|
||||
XML.SubElement(xml, 'canRoam').text = 'false'
|
||||
else:
|
||||
XML.SubElement(xml, 'canRoam').text = 'true'
|
||||
if 'retry-count' in data:
|
||||
XML.SubElement(xml, 'scmCheckoutRetryCount').text = \
|
||||
str(data['retry-count'])
|
||||
|
||||
if 'logrotate' in data:
|
||||
lr_xml = XML.SubElement(xml, 'logRotator')
|
||||
logrotate = data['logrotate']
|
||||
|
10
tests/general/fixtures/set-retry-count001.xml
Normal file
10
tests/general/fixtures/set-retry-count001.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<actions/>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<scmCheckoutRetryCount>8</scmCheckoutRetryCount>
|
||||
</project>
|
3
tests/general/fixtures/set-retry-count001.yaml
Normal file
3
tests/general/fixtures/set-retry-count001.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
name: openstack-infra
|
||||
project-type: freestyle
|
||||
retry-count: 8
|
Loading…
Reference in New Issue
Block a user