I\'ve stored username and password as credentials in jenkins. Now I would like to use them in my Jenkinsfile.
I am using withCredentials DSL, however, I\'m
withCredentials
Here is a tiny bit simpler version of StephenKing's answer
withCredentials([usernamePassword(credentialsId: 'mycreds', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { sh 'cf login some.awesome.url -u $USERNAME -p $PASSWORD' }