So far, I'm using the credentials plugin on Jenkins and I do a POST
to {JENKINS_URL}/credentials/store/system/domain/_/createCredentials
using a credentials.xml
that looks like this:
<com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
<scope>GLOBAL</scope>
<id>my-test-cred</id>
<description>This is an example from REST API</description>
<username>xyz-test</username>
<password>
xyz-yay
</password></com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
and it successfully creates a credential of type username:password
.
But suppose I want to create a credential of type secret-text
which would hold a token or a secret, like say, a GitHub token, how can I make a credentials.xml
for that kind? I've searched high and low and I cannot find a definitive guide here :-(