Add local-branch option
Change-Id: I5883992afc0875e2f464ff3f576b067f7d5b4ce8
This commit is contained in:
parent
604d39305b
commit
6b7162ea18
@ -59,6 +59,7 @@ def git(self, xml_parent, data):
|
||||
when polling for changes. (if polling is enabled)
|
||||
:arg list(str) included-regions: list of file/folders to include
|
||||
:arg list(str) excluded-regions: list of file/folders to exclude
|
||||
:arg str local-branch: Checkout/merge to local branch
|
||||
:arg dict merge:
|
||||
:merge:
|
||||
* **remote** (`string`) - name of repo that contains branch to
|
||||
@ -198,6 +199,10 @@ def git(self, xml_parent, data):
|
||||
xe.text = str(val).lower()
|
||||
else:
|
||||
xe.text = val
|
||||
|
||||
if 'local-branch' in data:
|
||||
XML.SubElement(scm, 'localBranch').text = data['local-branch']
|
||||
|
||||
browser = data.get('browser', 'auto')
|
||||
browserdict = {'githubweb': 'GithubWeb',
|
||||
'fisheye': 'FisheyeGitRepositoryBrowser',
|
||||
|
38
tests/scm/fixtures/local-branch001.xml
Normal file
38
tests/scm/fixtures/local-branch001.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?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://github.com/openstack-infra/jenkins-job-builder.git</url>
|
||||
</hudson.plugins.git.UserRemoteConfig>
|
||||
</userRemoteConfigs>
|
||||
<branches>
|
||||
<hudson.plugins.git.BranchSpec>
|
||||
<name>master</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>
|
||||
<localBranch>master</localBranch>
|
||||
</scm>
|
||||
</project>
|
6
tests/scm/fixtures/local-branch001.yaml
Normal file
6
tests/scm/fixtures/local-branch001.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
scm:
|
||||
- git:
|
||||
url: https://github.com/openstack-infra/jenkins-job-builder.git
|
||||
branches:
|
||||
- master
|
||||
local-branch: master
|
Loading…
Reference in New Issue
Block a user