Defining Parameters

There are 3 ways to define parameters, you can see them in the example below:

parameters:
    nameA: "value1"
    nameB:
        value: "value2"
        description: "description of nameB"
    nameC: ["value1", "value2"]

Parameters is a dictionary which expects key:value pairs.

parameters:
    nameA: "value1"

key: string (see example above) is a shorthand for writing as key:value (see example below).

parameters:
    nameA:
        value: "value1"
        description: ""

These two examples above are equivalent.

You can also define parameters in an array for drop down options. The first value in the array is picked up as default, e.g value1 is selected as default in the example below:

parameters:
    nameA: ["value1", "value2"]

Example

You can see a full screwdriver.yaml example below:

shared:
    image: node:8

parameters:
    region: "us-west-1"
    az:
        value: "1"
        description: "default availability zone"
    cluster: ["cluster1", "cluster2"]

jobs:
    main:
        requires: [~pr, ~commit]
        steps:
            - step1: 'echo "Region: $(meta get parameters.region.value)"'
            - step2: 'echo "AZ: $(meta get parameters.az.value)"'
            - step3: 'echo "Cluster: $(meta get parameters.cluster.value)"'

You can also preview the parameters that are used during a build in the Setup -> sd-setup-init step.

Pipeline Preview Screenshot:

image

image

image

image

Please see parameters-build-sample as example.