Add support to specify GitLab version.

Change-Id: Iae3746540cb692b19278fd0bedae48bf976700d5
This commit is contained in:
Joao Vale 2014-01-09 17:51:31 +00:00
parent c39c5de446
commit cdd5ecfb43
3 changed files with 53 additions and 0 deletions

View File

@ -81,6 +81,7 @@ def git(self, xml_parent, data):
:arg bool wipe-workspace: Wipe out workspace before build
:arg str browser: what repository browser to use (default '(Auto)')
:arg str browser-url: url for the repository browser
:arg str browser-version: version of the repository browser (GitLab)
:arg str project-name: project name in Gitblit and ViewGit repobrowser
:arg str choosing-strategy: Jenkins class for selecting what to build
:arg str git-config-name: Configure name for Git clone
@ -222,6 +223,9 @@ def git(self, xml_parent, data):
if browser in ['gitblit', 'viewgit']:
XML.SubElement(bc, 'projectName').text = str(
data.get('project-name', ''))
if browser == 'gitlab':
XML.SubElement(bc, 'version').text = str(
data.get('browser-version', '0.0'))
def repo(self, xml_parent, data):

View File

@ -0,0 +1,41 @@
<?xml version="1.0" ?>
<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>git@gitlab.example.com:foo/bar.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>origin/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>
<browser class="hudson.plugins.git.browser.GitLab">
<url>https://gitlab.example.com/foo/bar/</url>
<version>5.2</version>
</browser>
</scm>
</project>

View File

@ -0,0 +1,8 @@
scm:
- git:
url: "git@gitlab.example.com:foo/bar.git"
branches:
- origin/master
browser: gitlab
browser-url: "https://gitlab.example.com/foo/bar/"
browser-version: "5.2"