git: Support timeout option

This requires git plugin version 2.2.3

Change-Id: I24a2bce00e35f74a5c513d02a7bffe05267cd498
This commit is contained in:
Guido Günther 2014-08-01 11:17:05 +02:00
parent ca6335d770
commit 0268581fca
3 changed files with 14 additions and 0 deletions

View File

@ -96,6 +96,7 @@ remoteName/\*')
(default 'default')
:arg str git-config-name: Configure name for Git clone (optional)
:arg str git-config-email: Configure email for Git clone (optional)
:arg str timeout: Timeout for git commands in minutes (optional)
:browser values:
:auto:
@ -222,6 +223,13 @@ remoteName/\*')
if 'local-branch' in data:
XML.SubElement(scm, 'localBranch').text = data['local-branch']
if 'timeout' in data:
ext = XML.SubElement(scm, 'extensions')
co = XML.SubElement(ext,
'hudson.plugins.git.extensions.impl.'
'CheckoutOption')
XML.SubElement(co, 'timeout').text = str(data['timeout'])
browser = data.get('browser', 'auto')
browserdict = {'auto': 'auto',
'bitbucketweb': 'BitbucketWeb',

View File

@ -37,6 +37,11 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions>
<hudson.plugins.git.extensions.impl.CheckoutOption>
<timeout>20</timeout>
</hudson.plugins.git.extensions.impl.CheckoutOption>
</extensions>
<browser class="hudson.plugins.git.browser.GithubWeb">
<url>http://github.com/foo/example.git</url>
</browser>

View File

@ -6,3 +6,4 @@ scm:
- stable
browser: githubweb
browser-url: http://github.com/foo/example.git
timeout: 20