-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withCredentials and usernamePassword Binder no longer works #320
Comments
I just ran a quick test of this locally and didn't run into any problems (yes, the old "it works on my machine™" line 😅) It would be interesting to see a full stacktrace of the error, or at least one with frames from |
I have the same issue. Since 1.4 my pipeline is no longer working. def withCredentialsInterceptor = { list, closure ->
[...]
creds.each { var ->
try {
previousValues[var] = binding.getVariable(var) // <-- here
} catch (MissingPropertyException e) {
previousValues[var] = null
}
binding.setVariable(var, var)
}
[...]
The variables (
If you try to get a binding variable, which is not existing, then Groovy throws this error. if (binding.hasVariable(var.key)) {
previousValues[var] = binding.getVariable(var)
} Stacktrace:
This isthe method, which is creating the static void executeGradleCommandWithCredentials(final Script script, final String command, final String artifactoryCredentialsId) {
script.withCredentials([ script.usernamePassword(
credentialsId: artifactoryCredentialsId,
usernameVariable: 'ORG_GRADLE_PROJECT_ARTIFACTORY_USER',
passwordVariable: 'ORG_GRADLE_PROJECT_ARTIFACTORY_TOKEN'
) ]) {
script.sh "${command}"
}
} |
(Maybe related: #298 (comment)?) |
Hi there!
In my code, I've something like that
I'm using JenkinsPipelineUnit to test my custom groovy functions. Tests are passing fine when running with JenkinsPipelineUnit up to v1.3.
Starting from v1.4, tests are failing with the following errors
for v1.4 and v1.5. While starting from v1.6
I checked credentials-binding the documentation, and my code seems ok.
Do you have any suggestion?
The text was updated successfully, but these errors were encountered: