我想在我的工作中添加秘密文件,但我找不到Jenkis DSL中的哪个关键字,有什么建议吗?
在xml中它看起来像这样:
<project>
...
<properties>...</properties>
<scm class="hudson.scm.NullSCM"/>
<builders>...</builders>
<buildWrappers>
<org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper plugin="credentials-binding@1.10">
<bindings>
<org.jenkinsci.plugins.credentialsbinding.impl.FileBinding>
<credentialsId>my-keytab</credentialsId>
<variable>KEYTAB</variable>
</org.jenkinsci.plugins.credentialsbinding.impl.FileBinding>
</bindings>
</org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper>
</buildWrappers>
</project>
答案 0 :(得分:2)
您可以在file
上下文中使用credentialsBinding
。
job('example') {
wrappers {
credentialsBinding {
file('KEYTAB', 'my-keytab')
}
}
}
有关详细信息,请参阅API Viewer。