Update SCM Wipe workspace to use extensions style

Use the newer extensions style configuration for the SCM Wipe workspace
option. This change simply changes the output style of this
configuration leaving the original YAML configuration values in tact so
it is backwards compatible with the old style configuration for
wipe-workspace setting.

While this patch still sets the old <wipeOutWorkspace> value long with
the new extensions value. Jenkins appears to be happy with both values
present and prefers the extensions format if it exists. This should
allow the older Jenkins that only supports the older config format to
continue to work.

Change-Id: Ib5b1809d19a35f83f524ee84b18f0c58b851c70b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This commit is contained in:
Thanh Ha
2015-01-17 11:45:44 -05:00
parent 09bd39fd64
commit d7c37c89a8
25 changed files with 82 additions and 25 deletions

View File

@@ -89,7 +89,6 @@ remoteName/\*')
:arg str reference-repo: Path of the reference repo to use during clone
(optional)
:arg str scm-name: The unique scm name for this Git SCM (optional)
:arg bool wipe-workspace: Wipe out workspace before build (default true)
:arg bool ignore-notify: Ignore notifyCommit URL accesses (default false)
:arg str browser: what repository browser to use (default '(Auto)')
:arg str browser-url: url for the repository browser (required if browser
@@ -127,6 +126,8 @@ remoteName/\*')
submodules operations (default: 10).
:arg str timeout: Timeout for git commands in minutes (optional)
:arg bool wipe-workspace: Wipe out workspace before build
(default true)
:browser values:
:auto:
@@ -294,6 +295,11 @@ remoteName/\*')
'hudson.plugins.git.extensions.impl.'
'CheckoutOption')
XML.SubElement(co, 'timeout').text = str(data['timeout'])
# By default we wipe the workspace
wipe_workspace = str(data.get('wipe-workspace', True)).lower()
if wipe_workspace == 'true':
ext_name = 'hudson.plugins.git.extensions.impl.WipeWorkspace'
ext = XML.SubElement(exts_node, ext_name)
browser = data.get('browser', 'auto')
browserdict = {'auto': 'auto',

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>
@@ -92,7 +94,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>
@@ -92,7 +94,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -44,7 +44,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<scm class="hudson.plugins.git.GitSCM">
<configVersion>2</configVersion>
@@ -80,7 +82,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</scms>
</scm>

View File

@@ -56,7 +56,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</scms>
</scm>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>

View File

@@ -34,6 +34,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>true</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -34,6 +34,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -34,6 +34,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -40,6 +40,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -35,6 +35,8 @@
<scmName/>
<useShallowClone>true</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -34,6 +34,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -34,6 +34,8 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -39,6 +39,7 @@
<trackingSubmodules>true</trackingSubmodules>
<timeout>15</timeout>
</hudson.plugins.git.extensions.impl.SubmoduleOption>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -41,6 +41,7 @@
<hudson.plugins.git.extensions.impl.CheckoutOption>
<timeout>20</timeout>
</hudson.plugins.git.extensions.impl.CheckoutOption>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
<browser class="hudson.plugins.git.browser.GithubWeb">
<url>http://github.com/foo/example.git</url>

View File

@@ -47,6 +47,7 @@
<hudson.plugins.git.extensions.impl.CheckoutOption>
<timeout>20</timeout>
</hudson.plugins.git.extensions.impl.CheckoutOption>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
<browser class="hudson.plugins.git.browser.GithubWeb">
<url>http://github.com/foo/example.git</url>

View File

@@ -34,7 +34,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
<browser class="hudson.plugins.git.browser.GitLab">
<url>https://gitlab.example.com/foo/bar/</url>
<version>5.2</version>

View File

@@ -35,6 +35,8 @@
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<localBranch>master</localBranch>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
</project>

View File

@@ -34,7 +34,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
<browser class="hudson.plugins.git.browser.Stash">
<url>https://stash.example.com/projects/foo/repos/bar/</url>
</browser>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
<browser class="hudson.plugins.git.browser.GitWeb">
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
</browser>

View File

@@ -42,7 +42,9 @@
<scmName/>
<useShallowClone>false</useShallowClone>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<extensions/>
<extensions>
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
</extensions>
</scm>
<builders/>
<publishers/>