shiva
shiva

Reputation: 186

Jenkins declarative pipeline with list-git-branches-parameter-plugin

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, ...]]

Upvotes: 2

Views: 648

Answers (1)

shiva
shiva

Reputation: 186

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)
                                }
                   }

Upvotes: 1

Related Questions