Overriding default parameter when building one Jenkins pipeline from another

ぃ、小莉子 提交于 2021-02-10 12:38:20

问题


Goal: override a Jenkins Boolean parameter default value (true) with false when I build from another Jenkins script

I've check the suggested possible answers from other StackOverflow items; nothing seems to match. They did, however, show me how to use parameters when calling one Jenkins script from another. (Thanks!)

I can pass a value of true to a non-default parameter to change its value from false to true. But when I try to pass a value of false to a parameter where I have checked the "Default Value" box in the Configure view, the value stays true.

Jenkins is running on Windows 10

build job: 'other_build', parameters[booleanParam(name: 'param_no_default_value', value: true) ]

build job: 'other_build', parameters[booleanParam (name: 'param_default_value', value: false) ]

Overriding the parameter that doesn't have a default value works. Trying to override the parameter that does have a default value doesn't work. So does checking the value in the configuration file trump setting it from the other job?

== Added May 9, in response to @hakamairi's request for configuration (note: this is in Jenkins web interface): ==

In General area:
[checked] This project is parameterized
Boolean Parameter
Name: param_no_default_value
Default Value: [unchecked]

Boolean Paremeter
Name: param_default_value
Default Value: [checked]

In "Build with parameters," I do not check any boxes

Is there anything else that would help you?

来源:https://stackoverflow.com/questions/55912678/overriding-default-parameter-when-building-one-jenkins-pipeline-from-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!