How to use Jenkins parameterized builds?

后端 未结 1 1114
余生分开走
余生分开走 2020-12-06 09:09

Jenkins allows you to parameterize builds, but I can\'t figure out how to actually make use of it:

\"enter

相关标签:
1条回答
  • 2020-12-06 09:54

    Whenever the user configures a parameterised build in Jenkins, the parameter name is taken as an environment variable

    The user can make use of such parameters using the environment variable.

    For example, in your case if packageType is the parameter you want to pass,

    then specify the name as packageType and value as war

    You can use it in the script you required as %packageType% (for Batch) or $packageType (for shell)

    After configuring the job, whenever you click the build now button, Jenkins prompts for the parameter

    When you are using file Parameter, the uploaded file will be placed into the working directory

    0 讨论(0)
提交回复
热议问题