I have a lot of free-style jobs in my Jenkins instance. I create them with Jenkins API (generate XML-file with configuration and post them by "http://my-jenkins-instance:8080/createItem?name=JobName"). There is one problem - I can not generate value in secret fields. For example, I want such a config:
Inject passwords to the build as environment variables -> Job passwords.
And I need to set 123
to Password
field.
I can not do this through XML because it appears decoded in XML. Something like this: {AQAAABAAAANwHq0hsSF6...}
I want to set the value to this parameter
So my questions are:
- Can I get the decoded value of a plain password through some API? So I could send
123
and get{AQAAABAAAANwHq0hsSF6...}
back. - If not, can I set secret value some other way? I can only think of using Selenium but it is too slow (comparing to API).