Merge "multibranch: Configurable script-path"

This commit is contained in:
Zuul 2018-06-21 17:36:35 +00:00 committed by Gerrit Code Review
commit 85d16244a1
11 changed files with 14 additions and 6 deletions

View File

@ -55,6 +55,8 @@ Plugins required:
(default '-1, all')
* **days-to-keep** (`int`): For how many days should a build be kept.
(default '-1, forever')
* **script-path** (`str`): Path to Jenkinsfile, relative to workspace.
(default 'Jenkinsfile')
Job examples:
@ -270,7 +272,8 @@ class WorkflowMultiBranch(jenkins_jobs.modules.base.Base):
'class': self.jenkins_class,
'reference': '../..'
})
XML.SubElement(factory, 'scriptPath').text = 'Jenkinsfile'
XML.SubElement(factory, 'scriptPath').text = data.get(
'script-path', 'Jenkinsfile')
return xml_parent

View File

@ -79,6 +79,6 @@
</sources>
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
<scriptPath>Jenkinsfile</scriptPath>
<scriptPath>some.Jenkinsfile</scriptPath>
</factory>
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>

View File

@ -7,6 +7,7 @@ periodic-folder-trigger: 1d
prune-dead-branches: True
number-to-keep: '10'
days-to-keep: '10'
script-path: 'some.Jenkinsfile'
scm:
- bitbucket:
repo-owner: 'SANDBOX'

View File

@ -47,6 +47,6 @@
</sources>
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
<scriptPath>Jenkinsfile</scriptPath>
<scriptPath>some.Jenkinsfile</scriptPath>
</factory>
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>

View File

@ -1,5 +1,6 @@
name: 'demo-multibranch-bitbucket-min'
project-type: multibranch
script-path: 'some.Jenkinsfile'
scm:
- bitbucket:
credentials-id: 'secret'

View File

@ -55,6 +55,6 @@
</sources>
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
<scriptPath>Jenkinsfile</scriptPath>
<scriptPath>some.Jenkinsfile</scriptPath>
</factory>
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>

View File

@ -1,5 +1,6 @@
name: 'demo-multibranch-gerrit-min'
project-type: multibranch
script-path: some.Jenkinsfile
scm:
- gerrit:
url: 'https://review.gerrithub.io/johndoe/foo'

View File

@ -46,6 +46,6 @@
</sources>
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
<scriptPath>Jenkinsfile</scriptPath>
<scriptPath>some.Jenkinsfile</scriptPath>
</factory>
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>

View File

@ -1,5 +1,6 @@
name: 'demo-multibranch-git-min'
project-type: multibranch
script-path: some.Jenkinsfile
scm:
- git:
url: 'https://example.com/jonhndoe/keep-frontend.git'

View File

@ -57,6 +57,6 @@
</sources>
<factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
<owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
<scriptPath>Jenkinsfile</scriptPath>
<scriptPath>some.Jenkinsfile</scriptPath>
</factory>
</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>

View File

@ -1,5 +1,6 @@
name: scm-github-full
project-type: multibranch
script-path: some.Jenkinsfile
scm:
- github:
api-uri: http://example.org/github