Reputation: 5220
I would like to add secret file to my job, but I can't find which keyword from Jenkis DSL it is, any suggestions?
In xml it looks like this:
<project>
...
<properties>...</properties>
<scm class="hudson.scm.NullSCM"/>
<builders>...</builders>
<buildWrappers>
<org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper plugin="[email protected]">
<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>
Upvotes: 1
Views: 2042
Reputation: 8194
You can use file
within the credentialsBinding
context.
job('example') {
wrappers {
credentialsBinding {
file('KEYTAB', 'my-keytab')
}
}
}
See the API Viewer for details.
Upvotes: 3