Git Parameters Plugin & Declarative Pipeline

114 views
Skip to first unread message

Suckow, Thomas J

unread,
Jun 4, 2018, 2:04:51 PM6/4/18
to jenkins...@googlegroups.com

Alternate title: Converting custom parameters from non-declarative pipeline to declarative pipeline

 

I’m trying to add a git parameter to a pipeline job using the newer declarative syntax.

 

What I found:

 

properties([

    [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false],

    parameters([

        [$class: 'GitParameterDefinition',

                 branch: '',

                 branchFilter: '.*',

                 defaultValue: '',

                 description: 'description',

                 name: 'BRANCH_PARAM',

                 quickFilterEnabled: false,

                 selectedValue: 'NONE', sortMode: 'NONE',tagFilter: '*', type: 'PT_BRANCH']

    ]),

    pipelineTriggers([])

])

 

 

 

 

What I tried:

pipeline {

    agent none

   

    parameters {

        [$class: 'GitParameterDefinition',

            branch: '',

            branchFilter: '.*',

            defaultValue: '',

            description: 'Version to release',

            name: 'RELEASE_VERSION',

            quickFilterEnabled: false,

            selectedValue: 'NONE',

            sortMode: 'DESCENDING_SMART',

            tagFilter: '*',

            type: 'PT_TAG']

    }

 

   […]

}

 

Which doesn’t do anything, it is like I didn’t specify parameters at all.

 

I can’t find any examples of using a plugin provided parameter using the newer syntax. Is it even possible?

 

--

Thomas Suckow

(509) 372-6096

 

Reply all
Reply to author
Forward
0 new messages