带有文件系统列表参数的管道
pipeline with Filesystem List Parameter
我正在尝试使用 Filesystem List Parameter
参数编写管道:
但我无法在任何地方找到正确的语法,即使在 Jenkins 文档中也是如此。 Jenkins 管道中是否允许使用此插件?如果是这样,那么语法是什么?
https://plugins.jenkins.io/filesystem-list-parameter-plugin/
谢谢
参见Pipeline Syntax → input
→ parameters
→ $class: 'FileSystemListParameterDefinition'
:
stages {
stage('Parameters') {
steps {
script {
// one parameter
def value = input( message: 'Select parameter value:',
parameters: [
[$class: 'FileSystemListParameterDefinition',
name: 'SingleFileSystemObject',
description: 'Single file system object',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'SINGLE_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
] // parameters
] // input
)
// more parameters, displayed on a separate parameter input page
Map values = input( message: 'Select parameter values:',
parameters: [
[$class: 'FileSystemListParameterDefinition',
name: 'SingleFileSystemObject',
description: 'Single file system object',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'SINGLE_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
],
[$class: 'FileSystemListParameterDefinition',
name: 'MultipleFileSystemObjects',
description: 'Multiple file system objects',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'MULTI_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
]
] // parameters
) // input
echo value
print values['SingleFileSystemObject']
print values['MultipleFileSystemObjects']
}
}
}
}
控制台输出
例如:
...
[Pipeline] echo
root
[Pipeline] echo
bin
[Pipeline] echo
home,usr
...
我正在尝试使用 Filesystem List Parameter
参数编写管道:
但我无法在任何地方找到正确的语法,即使在 Jenkins 文档中也是如此。 Jenkins 管道中是否允许使用此插件?如果是这样,那么语法是什么?
https://plugins.jenkins.io/filesystem-list-parameter-plugin/
谢谢
参见Pipeline Syntax → input
→ parameters
→ $class: 'FileSystemListParameterDefinition'
:
stages {
stage('Parameters') {
steps {
script {
// one parameter
def value = input( message: 'Select parameter value:',
parameters: [
[$class: 'FileSystemListParameterDefinition',
name: 'SingleFileSystemObject',
description: 'Single file system object',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'SINGLE_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
] // parameters
] // input
)
// more parameters, displayed on a separate parameter input page
Map values = input( message: 'Select parameter values:',
parameters: [
[$class: 'FileSystemListParameterDefinition',
name: 'SingleFileSystemObject',
description: 'Single file system object',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'SINGLE_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
],
[$class: 'FileSystemListParameterDefinition',
name: 'MultipleFileSystemObjects',
description: 'Multiple file system objects',
nodeName: 'master',
path: '/',
selectedType: 'ALL',
formSelectType: 'MULTI_SELECT',
regexIncludePattern: '',
regexExcludePattern: '',
sortReverseOrder: false
]
] // parameters
) // input
echo value
print values['SingleFileSystemObject']
print values['MultipleFileSystemObjects']
}
}
}
}
控制台输出
例如:
...
[Pipeline] echo
root
[Pipeline] echo
bin
[Pipeline] echo
home,usr
...