0

I have declarative parametrized pipeline from SCM, something like this:

parameters {
    string(name: 'USER', defaultValue: params.USER ?:'default_value', trim: true)
    password(name: 'PASSWORD', defaultValue: params.PASSWORD ?:'default_value')
< ... and bunch of params more ... >
}

Idea is to use same Jenkinsfile for several environments/projects, and override those values manually in UI accordingly. If there's a value defined already - skip it during the next build.

string parameter does exactly what I want, as described here.

Problem is that Elvis operator ?: acts strange with password parameter type. It basically erases existing password value on first build if it finds it there. If I try a second build (when password is already erased during previous build), then it provides default value. And over and over…

Does anybody have any idea why that works for string parameter but not for password parameter, and how to override that issue? Except creating password parameter manually in UI, and kicking it out from Jenkinsfile, of course.

Thanks.

i8z
  • 3
  • 2

1 Answers1

0

you can use rebuild link button/plugin with enabled "Remember Password Enabled" in jenkins global security

what are you trying to do was removed from jenkins because of security reasons

https://www.jenkins.io/security/advisory/2022-02-15/#SECURITY-2443

Ruslan
  • 444
  • 3
  • 8