Parameters

The Parameters module allows you to specify build parameters for a job.

Component: parameters
Macro:parameter
Entry Point:jenkins_jobs.parameters

Example:

job:
  name: test_job

  parameters:
    - string:
        name: FOO
        default: bar
        description: "A parameter named FOO, defaults to 'bar'."
bool

A boolean parameter.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - bool:
      name: FOO
      default: false
      description: "A parameter named FOO, defaults to 'false'."
choice

A single selection parameter.

Parameters:
  • name (str) – the name of the parameter
  • choices (list) – the available choices
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - choice:
      name: project
      choices:
        - nova
        - glance
      description: "On which project to run?"
file

A file parameter.

Parameters:
  • name (str) – the target location for the file upload
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - file:
      name: test.txt
      description: "Upload test.txt."
label

A node label parameter.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - label:
      name: node
      default: precise
      description: "The node on which to run the job"
string

A string parameter.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - string:
      name: FOO
      default: bar
      description: "A parameter named FOO, defaults to 'bar'."
svn-tags

A svn tag parameter Requires the Jenkins Parameterized Trigger Plugin.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)
  • url (str) – the url to list tags from
  • filter (str) – the regular expression to filter tags

Example:

parameters:
  - svn-tags:
      name: BRANCH_NAME
      default: release
      description: A parameter named BRANCH_NAME default is release
      url: http://svn.example.com/repo
      filter: [A-za-z0-9]*
text

A text parameter.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)

Example:

parameters:
  - text:
      name: FOO
      default: bar
      description: "A parameter named FOO, defaults to 'bar'."
validating-string

A validating string parameter Requires the Jenkins Validating String Plugin.

Parameters:
  • name (str) – the name of the parameter
  • default (str) – the default value of the parameter (optional)
  • description (str) – a description of the parameter (optional)
  • regex (str) – a regular expression to validate the string
  • msg (str) – a message to display upon failed validation

Example:

parameters:
  - validating-string:
      name: FOO
      default: bar
      description: "A parameter named FOO, defaults to 'bar'."
      regex: [A-Za-z]*
      msg: Your entered value failed validation

Previous topic

Notifications

Next topic

Properties

This Page