add support to git for changelog against branch
added support for another extension type, and fix how extensions are populated to xml Change-Id: Ic9cf21a268d4ee3fb9b9efdee65c3d49e0cdb31e Signed-off-by: Kyle Rockman <kyle.rockman@mac.com>
This commit is contained in:
parent
445c73a298
commit
009b362968
@ -96,7 +96,17 @@ remoteName/\*')
|
|||||||
(default 'default')
|
(default 'default')
|
||||||
:arg str git-config-name: Configure name for Git clone (optional)
|
:arg str git-config-name: Configure name for Git clone (optional)
|
||||||
:arg str git-config-email: Configure email 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)
|
|
||||||
|
|
||||||
|
:extensions:
|
||||||
|
:arg dict changelog-against:
|
||||||
|
:changelog-against:
|
||||||
|
* **remote** (`string`) - name of repo that contains branch to
|
||||||
|
create changelog against (default 'origin')
|
||||||
|
* **branch** (`string`) - name of the branch to create
|
||||||
|
create changelog against (default 'master')
|
||||||
|
|
||||||
|
:arg str timeout: Timeout for git commands in minutes (optional)
|
||||||
|
|
||||||
:browser values:
|
:browser values:
|
||||||
:auto:
|
:auto:
|
||||||
@ -223,9 +233,17 @@ remoteName/\*')
|
|||||||
if 'local-branch' in data:
|
if 'local-branch' in data:
|
||||||
XML.SubElement(scm, 'localBranch').text = data['local-branch']
|
XML.SubElement(scm, 'localBranch').text = data['local-branch']
|
||||||
|
|
||||||
|
exts_node = XML.SubElement(scm, 'extensions')
|
||||||
|
if 'changelog-against' in data:
|
||||||
|
ext_name = 'hudson.plugins.git.extensions.impl.ChangelogToBranch'
|
||||||
|
ext = XML.SubElement(exts_node, ext_name)
|
||||||
|
opts = XML.SubElement(ext, 'options')
|
||||||
|
change_remote = data['changelog-against'].get('remote', 'origin')
|
||||||
|
change_branch = data['changelog-against'].get('branch', 'master')
|
||||||
|
XML.SubElement(opts, 'compareRemote').text = change_remote
|
||||||
|
XML.SubElement(opts, 'compareTarget').text = change_branch
|
||||||
if 'timeout' in data:
|
if 'timeout' in data:
|
||||||
ext = XML.SubElement(scm, 'extensions')
|
co = XML.SubElement(exts_node,
|
||||||
co = XML.SubElement(ext,
|
|
||||||
'hudson.plugins.git.extensions.impl.'
|
'hudson.plugins.git.extensions.impl.'
|
||||||
'CheckoutOption')
|
'CheckoutOption')
|
||||||
XML.SubElement(co, 'timeout').text = str(data['timeout'])
|
XML.SubElement(co, 'timeout').text = str(data['timeout'])
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
@ -91,6 +92,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
@ -91,6 +92,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<scm class="hudson.plugins.git.GitSCM">
|
<scm class="hudson.plugins.git.GitSCM">
|
||||||
<configVersion>2</configVersion>
|
<configVersion>2</configVersion>
|
||||||
@ -79,6 +80,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</scms>
|
</scms>
|
||||||
</scm>
|
</scm>
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</scms>
|
</scms>
|
||||||
</scm>
|
</scm>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
@ -34,5 +34,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>true</ignoreNotifyCommit>
|
<ignoreNotifyCommit>true</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -34,5 +34,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -34,5 +34,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -40,5 +40,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -35,5 +35,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>true</useShallowClone>
|
<useShallowClone>true</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -34,5 +34,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -34,5 +34,6 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
55
tests/scm/fixtures/git002.xml
Normal file
55
tests/scm/fixtures/git002.xml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<scm class="hudson.plugins.git.GitSCM">
|
||||||
|
<configVersion>2</configVersion>
|
||||||
|
<userRemoteConfigs>
|
||||||
|
<hudson.plugins.git.UserRemoteConfig>
|
||||||
|
<name>origin</name>
|
||||||
|
<refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
|
||||||
|
<url>https://example.com/project.git</url>
|
||||||
|
</hudson.plugins.git.UserRemoteConfig>
|
||||||
|
</userRemoteConfigs>
|
||||||
|
<branches>
|
||||||
|
<hudson.plugins.git.BranchSpec>
|
||||||
|
<name>master</name>
|
||||||
|
</hudson.plugins.git.BranchSpec>
|
||||||
|
<hudson.plugins.git.BranchSpec>
|
||||||
|
<name>stable</name>
|
||||||
|
</hudson.plugins.git.BranchSpec>
|
||||||
|
</branches>
|
||||||
|
<excludedUsers/>
|
||||||
|
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
|
||||||
|
<disableSubmodules>false</disableSubmodules>
|
||||||
|
<recursiveSubmodules>false</recursiveSubmodules>
|
||||||
|
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
|
||||||
|
<authorOrCommitter>false</authorOrCommitter>
|
||||||
|
<clean>false</clean>
|
||||||
|
<wipeOutWorkspace>true</wipeOutWorkspace>
|
||||||
|
<pruneBranches>false</pruneBranches>
|
||||||
|
<remotePoll>false</remotePoll>
|
||||||
|
<gitTool>Default</gitTool>
|
||||||
|
<submoduleCfg class="list"/>
|
||||||
|
<relativeTargetDir/>
|
||||||
|
<reference/>
|
||||||
|
<gitConfigName/>
|
||||||
|
<gitConfigEmail/>
|
||||||
|
<skipTag>false</skipTag>
|
||||||
|
<scmName/>
|
||||||
|
<useShallowClone>false</useShallowClone>
|
||||||
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions>
|
||||||
|
<hudson.plugins.git.extensions.impl.ChangelogToBranch>
|
||||||
|
<options>
|
||||||
|
<compareRemote>origin</compareRemote>
|
||||||
|
<compareTarget>master</compareTarget>
|
||||||
|
</options>
|
||||||
|
</hudson.plugins.git.extensions.impl.ChangelogToBranch>
|
||||||
|
<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>
|
||||||
|
</scm>
|
||||||
|
</project>
|
12
tests/scm/fixtures/git002.yaml
Normal file
12
tests/scm/fixtures/git002.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
scm:
|
||||||
|
- git:
|
||||||
|
url: https://example.com/project.git
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- stable
|
||||||
|
browser: githubweb
|
||||||
|
browser-url: http://github.com/foo/example.git
|
||||||
|
timeout: 20
|
||||||
|
changelog-against:
|
||||||
|
remote: origin
|
||||||
|
branch: master
|
@ -34,6 +34,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
<browser class="hudson.plugins.git.browser.GitLab">
|
<browser class="hudson.plugins.git.browser.GitLab">
|
||||||
<url>https://gitlab.example.com/foo/bar/</url>
|
<url>https://gitlab.example.com/foo/bar/</url>
|
||||||
<version>5.2</version>
|
<version>5.2</version>
|
||||||
|
@ -35,5 +35,6 @@
|
|||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
<localBranch>master</localBranch>
|
<localBranch>master</localBranch>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
</project>
|
</project>
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
<browser class="hudson.plugins.git.browser.Stash">
|
<browser class="hudson.plugins.git.browser.Stash">
|
||||||
<url>https://stash.example.com/projects/foo/repos/bar/</url>
|
<url>https://stash.example.com/projects/foo/repos/bar/</url>
|
||||||
</browser>
|
</browser>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
<browser class="hudson.plugins.git.browser.GitWeb">
|
<browser class="hudson.plugins.git.browser.GitWeb">
|
||||||
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
<url>http://review.openstack.org/gitweb?p=openstack-infra/jenkins-job-builder.git</url>
|
||||||
</browser>
|
</browser>
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
<scmName/>
|
<scmName/>
|
||||||
<useShallowClone>false</useShallowClone>
|
<useShallowClone>false</useShallowClone>
|
||||||
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
<ignoreNotifyCommit>false</ignoreNotifyCommit>
|
||||||
|
<extensions/>
|
||||||
</scm>
|
</scm>
|
||||||
<builders/>
|
<builders/>
|
||||||
<publishers/>
|
<publishers/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user