Issue
I use listgitbranch plugin in my script but it doesn't work correctly and I faced with the following error. This is the script:
- script:
pipelineJob('app-Build-and-Deploy') {
parameters {
listGitBranches(branchFilter: '(.*)/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'BRANCH', remoteURL: '[email protected]:app/my_app.git
}
definition { ...
Error:
groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.BuildParametersContext.listGitBranches() is applicable for argument types: (java.util.LinkedHashMap) values: [[branchFilter:(.*)/(.*), defaultValue:master, name:BRANCH, type:BRANCH, ...]]
Solution
Here is the right format:
pipelineJob('app-Build-and-Deploy') {
parameters {
listGitBranches{
name('BRANCH')
description('BRANCH')
remoteURL('[email protected]:apps/my-app.git')
credentialsId('deployer')
defaultValue('master')
branchFilter('(.*)/(.*)')
type('BRANCH')
sortMode('DESCENDING')
selectedValue('TOP')
tagFilter('')
listSize('10')
quickFilterEnabled(true)
}
}
Answered By - shiva
Answer Checked By - David Goodson (JavaFixing Volunteer)