The Parameters module allows you to specify build parameters for a job.
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'."
A boolean parameter.
Parameters: |
|
---|
Example:
parameters:
- bool:
name: FOO
default: false
description: "A parameter named FOO, defaults to 'false'."
A single selection parameter.
Parameters: |
|
---|
Example:
parameters:
- choice:
name: project
choices:
- nova
- glance
description: "On which project to run?"
Control via a build parameter, which build the copyartifact plugin should copy when it is configured to use ‘build-param’. Requires the Jenkins Copy Artifact plugin.
Parameters: |
|
---|
Example:
parameters:
- copyartifact-build-selector:
name: BUILD_SELECTOR
which-build: workspace-latest
description: 'Which build from upstream to copy artifacts from'
Dynamic Choice Parameter Requires the Jenkins Jenkins Dynamic Parameter Plug-in.
Parameters: |
|
---|
Example:
parameters:
- dynamic-choice:
name: OPTIONS
description: "Available options"
script: "['optionA', 'optionB']"
remote: false
read-only: false
Dynamic Choice Parameter (Scriptler) Requires the Jenkins Jenkins Dynamic Parameter Plug-in.
Parameters: |
|
---|
Example:
parameters:
- dynamic-choice-scriptler:
name: OPTIONS
description: "Available options"
script-id: "scriptid.groovy"
parameters:
- name: param1
value: value1
- name: param2
value: value2
remote: false
read-only: false
Dynamic Parameter Requires the Jenkins Jenkins Dynamic Parameter Plug-in.
Parameters: |
|
---|
Example:
parameters:
- dynamic-string:
name: FOO
description: "A parameter named FOO, defaults to 'bar'."
script: "bar"
remote: false
read-only: false
Dynamic Parameter (Scriptler) Requires the Jenkins Jenkins Dynamic Parameter Plug-in.
Parameters: |
|
---|
Example:
parameters:
- dynamic-string-scriptler:
name: FOO
description: "A parameter named FOO, defaults to 'bar'."
script-id: "scriptid.groovy"
parameters:
- name: param1
value: value1
- name: param2
value: value2
remote: false
read-only: false
Creates an extended choice parameter where values can be read from a file Requires the Jenkins Extended Choice Parameter Plugin.
Parameters: |
|
---|
Example:
parameters:
- extended-choice:
name: OPTIONS
description: "Available options"
type: 'PT_CHECKBOX'
value: OptionA,OptionB,OptionC
visible-item-count: "2"
A file parameter.
Parameters: |
|
---|
Example:
parameters:
- file:
name: test.txt
description: "Upload test.txt."
A node label parameter.
Parameters: |
|
---|
Example:
parameters:
- label:
name: node
default: precise
description: "The node on which to run the job"
Matrix combinations parameter Requires the Jenkins Matrix Combinations Plugin.
Parameters: |
|
---|
Example:
parameters:
- matrix-combinations:
name: FOO
description: "Select matrix combinations"
filter: "platform == foo"
Defines a list of nodes where this job could potentially be executed on. Restrict where this project can be run, If your using a node or label parameter to run your job on a particular node, you should not use the option “Restrict where this project can be run” in the job configuration - it will not have any effect to the selection of your node anymore!
Parameters: |
|
---|
Example:
parameters:
- node:
name: SLAVE_NAME
description: "Select slave"
allowed-slaves:
- slave001
- slave002
- slave003
ignore-offline-nodes: true
allowed-multiselect: true
A password parameter.
Parameters: |
|
---|
Example:
parameters:
- password:
name: FOO
default: 1HSC0Ts6E161FysGf+e1xasgsHkgleLh09JUTYnipPvw=
description: "A parameter named FOO."
A run parameter.
Parameters: |
|
---|
Example:
parameters:
- run:
name: FOO
project-name: "foo-build"
description: "Select a foo-build for promotion"
A string parameter.
Parameters: |
|
---|
Example:
parameters:
- string:
name: FOO
default: bar
description: "A parameter named FOO, defaults to 'bar'."
A svn tag parameter Requires the Jenkins Parameterized Trigger Plugin.
Parameters: |
|
---|
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]*
A text parameter.
Parameters: |
|
---|
Example:
parameters:
- text:
name: FOO
default: bar
description: "A parameter named FOO, defaults to 'bar'."
A validating string parameter Requires the Jenkins Validating String Plugin.
Parameters: |
|
---|
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