Versions (current for each)...
- Jenkins - 2.8
- Credentials Plugin - 2.0.7
- Credentials Binding Plugin - 1.7
- Pipeline: Multibranch - 2.6
(let me know if you need any others)
- Working in a multibranch project
- Created a "Secret File" credential in the Global scope (just for testing) with id "settings-file".
- Jenkinsfile has:
node {
...
withCredentials([$class: 'FileBinding', credentialsId: 'settings-file', variable: 'SETTINGS_LOCATION']) {
sh "cp $SETTINGS_LOCATION ./settings.xml"
}
...
}
When it runs, get hit with...
groovy.lang.MissingPropertyException: No such property: SETTINGS_LOCATION for class: groovy.lang.Binding
Oddly, when I open the "Pipeline Syntax" at the project, I'm able to produce a Groovy snippet for the credential. But, if I open the "Pipeline Syntax" at the branch level (within the project folder), there are no credentials available for me to select in the snippet generator. So, it seems that the folder isn't getting the same visibility to the credential (even though it was defined globally).
Any pointers?
--
Michael Irwin