Hi,
Seems like I found some partial solution for this situation on Stack Overflow:
So this:
string(name: 'parameterName', defaultValue: params.parameterName ?:'your default value')
will preserve my parameters in UI from being overwritten by default value from Jenkinsfile/SCM
And that would be exactly what I wanted, but seems like this doesn’t work with passwords as mentioned in one of the comments.
@VladyslavKovalov I’ve tried already to nest my parameters under properties. Something like this:
properties([
parameters([
string(name: 'VAR1', description: 'some description', trim: true),
string(name: 'VAR2', description: 'some description', trim: true),
string(name: 'VAR3', description: 'some description', trim: true),
<... more parameters...>,
])
])
… but this fails with:
The ‘properties’ section has been renamed as of version 0.8. Use ‘options’ instead
I even tried to rename properties => options, but I still end up with bunch of errors.
That’s why I gave up on properties
.
I need those parameters in Jenkinsfile just to populate parameters fields in UI after first build, and then change them accordingly, because there are lot of properties there, and each project/environment has a different values there.