Hello,
I am trying to update my jenkins casc instance to pull credentials from an encrypted secrets file rather than from properties.yaml.
Currently I have a job in my jenkins casc instance which accesses credentials as follows:
freeStyleJob('myjob') {
wrappers {
credentialsBinding {
usernamePassword('userVariableName', 'passwordVariableName', 'credential-id')
}
}
The credentials are provided in casc.yaml
credentials:
system:
domainCredentials:
- credentials:
- usernamepassword:
scope: GLOBAL
id: "credential-id"
username: "user"
password: "pass123"
description: "default credentials."
However, instead of defining these credentials in casc.yaml, I want to define them in a secret file. I cannot find any documentation on whether it is possible to add a secret file via casc rather than by adding it through the jenkins web ui.
Furthermore, I am curious what the syntax of the secret file would be. Could I add the contents of casc.yaml to a secret file and access it from my job similar to how I am currently?
Thank you