Title: Message Title
Ulrich Lohrmann created an issue
Jenkins / JENKINS-60594
workflow-scm-step plugin does not use global credentials if used inside shared library
Issue Type:
Bug
Assignee:
Unassigned
Components:
workflow-scm-step-plugin
Created:
2019-12-27 11:26
Environment:
Jenkins 2.204.1 Credentials plugin 2.3.0 Credentials Binding Plugin 1.20 Pipeline SCM Step plugin 2.9
Priority:
Minor
Reporter:
Ulrich Lohrmann
When executing a GIT checkout with a SSH URL I can provide a credetialID (username with private key file) and the GIT repository is cloned using the credentials provided. So far so good. If I now move the checkout directive into a custom tag of a shared library and provide the credentialID from outside, the use of the credentials fails and the GIT repository cannot be accessed. GIT checkout from within pipeline script (works):
checkout([$class: 'GitSCM',
branches: [[name: "MyBranch"]],
doGenerateSubmoduleConfigurations: false,
extensions: optionalExtensions,
submoduleCfg: [],
userRemoteConfigs: [[url: 'ssh://..'], [credentialsId: 'MyGitCredentials']])
For easier use of the checkout command, I created a custom tag in a shared library that ony takes a subset of the possible arguments.
import groovy.transform.Field
@Field def zielverzeichnis
@Field def url
@Field def br