Pipeline script from git - credentials?

29 views
Skip to first unread message

christop...@googlemail.com

unread,
Apr 16, 2024, 8:36:58 AMApr 16
to Jenkins Users
Hi,

we are currently transforming all our SCMs to git. That worked for the jobs that rely on a global library and just have a function-call in the pipeline that's directly set in the job configuration.

However I have a couple of auxiliary jobs that are configured as 'Pipeline script from git'
Here I am experiencing some problems I am not used to from the old SCM:
- the selection 'credentials' is empty even though there are a couple of credentials in and escpecially one I use from a 'checkout' step from my library
- when I add new credentials with the button 'add' one line below the selection still does not show anything.
- the newly added credentials are shown in the global credentials administration list and I am not allowed it another time

Is there a known bug in this area or is there something I am doing wrong?

The version I am running is LTS 2.440.2 with git plugin 5.2.1, running on Windows.

Thanks for any help!

BR,
Christoph

Mark Waite

unread,
Apr 16, 2024, 10:11:28 AMApr 16
to Jenkins Users
On Tuesday, April 16, 2024 at 5:36:58 AM UTC-7 you wrote:
Hi,

we are currently transforming all our SCMs to git. That worked for the jobs that rely on a global library and just have a function-call in the pipeline that's directly set in the job configuration.

However I have a couple of auxiliary jobs that are configured as 'Pipeline script from git'
Here I am experiencing some problems I am not used to from the old SCM:
- the selection 'credentials' is empty even though there are a couple of credentials in and escpecially one I use from a 'checkout' step from my library
- when I add new credentials with the button 'add' one line below the selection still does not show anything.
- the newly added credentials are shown in the global credentials administration list and I am not allowed it another time

Is there a known bug in this area or is there something I am doing wrong?


You are probably seeing a limitation of the git plugin.  It accepts ssh private key credentials for git connections over ssh (either ssh:// or git@hostname:) and it accepts username / password credentials for git connections over HTTP (either http:// or https://). If your credential is a secret text or some other form of credential, the git plugin won't show it in the dropdown list because it only supports those two types of credentials.

Mark Waite

christop...@googlemail.com

unread,
Apr 16, 2024, 10:21:37 AMApr 16
to Jenkins Users
Hi Mark,

thanks for your support!
The URL is https:// the credentials stored are Username/password (with ID and key of an API-key of an internal gitlab-site).
As mentioned: it is working in the configuration of my shared library and from the checkout scm: scmGit(...)-step.
Ah, but in the library it is referred to as "modern scm". When I switch to "legacy SCM" and choose git I am running into the same problem.
Unfortunately I don't have the "modern"-choice for the pipeline script.

BR,
Christoph
Reply all
Reply to author
Forward
0 new messages