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:
Vitaliy Lotorev 2014-03-28 00:29:07 +04:00
parent 72c02d4106
commit c9c784aecc
4 changed files with 22 additions and 0 deletions

View File

@ -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:

View File

@ -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']

View 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>

View File

@ -0,0 +1,3 @@
name: openstack-infra
project-type: freestyle
retry-count: 8