我正在使用Jenkins hidden parameter plugin,但我无法找到在DSL中编写它的语法,就像我使用其他参数一样。Jenkins工作DSL插件 - 隐藏参数
有什么办法来反映DSL 隐藏参数?
我正在使用Jenkins hidden parameter plugin,但我无法找到在DSL中编写它的语法,就像我使用其他参数一样。Jenkins工作DSL插件 - 隐藏参数
有什么办法来反映DSL 隐藏参数?
之前使用declarative pipeline syntax(在jenkinsci/pipeline-model-definition-plugin
描述),你会使用:
但随着pure DSL pipeline syntax,这尚未得到支持(2017年4月)。
的最后一个问题,虽然指出了JENKINS-29922 (Promote delegates of metasteps to top-level functions, deprecate $class
),并增加了the comment:
实现,所以假设JENKINS-29922
@Symbol
为一种每个证书的定义,并且凭据步骤被标记metaStep,你可以写更简单地说:
usernamePassword id: 'hipchat-login', username: 'bob', password: 'abc/def+GHI0123='
hipchat server: …, message: …, credentialsId: 'hipchat-login'
甚至允许ID是GE nerated,并从步骤返回它:
hipchat server: …, message: …, credentialsId: usernamePassword(username: 'bob', password: 'abc/def+GHI0123=')
虽然这是加密的,这是不完全“隐藏”虽然。
作业DSL没有内置的对隐藏参数插件的支持,所以它在API查看器中没有提及。但它支持的Automatically Generated DSL:
job('example') {
parameters {
wHideParameterDefinition {
name('FOO')
defaultValue('bar')
description('lorem ipsum')
}
}
}
这似乎比我的答案更为确切。 +1 – VonC