插件简介
Git Parameter:增加了从项目中配置的git存储库中选择分支、标记或修订的能力。
插件安装
系统管理-插件管理安装此插件Git Parameter 插件
插件使用
☑ 新增一个Git参数
☑ 流水线代码如下
parameters {
gitParameter branch: '', branchFilter: 'origin/(.*)', defaultValue: '', description: '请选择要发布的代码分支或标签名称,默认值:', name: 'BRANCH', quickFilterEnabled: true, selectedValue: 'DEFAULT', sortMode: 'NONE', tagFilter: '*', type: 'GitParameterDefinition', useRepository: 'URL'
}
问题
使用界面或者流水线第一次构建后,会报错,提示未找到分支,再构建一次即可正常显示动态获取到的分支
Is this the end of our lives? Can’t still spell