How to access parameters in a Parameterized Build?

前端 未结 10 2084
你的背包
你的背包 2020-11-29 04:44

How do you access parameters set in the \"This build is parameterized\" section of a \"Workflow\" Jenkins job?

TEST CASE

10条回答
  •  死守一世寂寞
    2020-11-29 05:46

    Use double quotes instead of single quotes

    e.g. echo "$foo" as opposed to echo '$foo'

    If you configured your pipeline to accept parameters using the Build with Parameters option, those parameters are accessible as Groovy variables of the same name. See Here.

    You can drop the semicolon (;), drop the parentheses (( and )), and use single quotes (') instead of double (") if you do not need to perform variable substitutions. See Here. This clued me into my problem, though I've found that only the double (") is required to make it work.

提交回复
热议问题