-
Bug
-
Resolution: Fixed
-
Blocker
-
Jenkins 2.190.1 with xcode-plugin 2.0.12, job-dsl 1.76 and structs 1.20
When defining the parameter keychainPwd() using groovy for describing a job using DSL, it seems with the new version cannot be done.
When using a string, job DSL processing shows this error:
- Example: -->
keychainPwd('password')
Processing DSL script ios.groovy
ERROR: (unknown source) No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.keychainPwd() is applicable for argument types: (java.lang.String) values: [password]
Prior to 2.0.12 keychainPwd used a String.
- Example: -->
def keychainPwdVar = hudson.util.Secret.fromString('password')
keychainPwd(keychainPwdVar)
Processing DSL script ios.groovy
ERROR: (unknown source) No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.keychainPwd() is applicable for argument types: (hudson.util.Secret) values: [password]
In 2.0.12 keychainPwd could use a String (deprecated) or the newone Secret.
I have tested all kind of possible combinations without luck. Not sure if I should define it in other way or this is a kind of bug when usind DSL.
When unlocking a macOS keychain with Jenkins Xcode Plugin, keychainPwd is not a method, it is a parameter.
If you want to write a process to unlock the keychain in your Groovy script, you would write:
or
However, this method is not preferable because the password appears in the Groovy script, so it is recommended that you define a keychain password / pass pair as a credential and use it if possible.