diff --git a/docs/tasks.md b/docs/tasks.md index b39e0c7d245..ab4c36ce92c 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -449,10 +449,10 @@ You can specify parameters, such as compilation flags or artifact names, that yo Parameter names: -- Must only contain alphanumeric characters, hyphens (`-`), and underscores (`_`). +- Must only contain alphanumeric characters, hyphens (`-`), underscores (`_`), and dots (`.`). - Must begin with a letter or an underscore (`_`). -For example, `fooIs-Bar_` is a valid parameter name, but `barIsBa$` or `0banana` are not. +For example, `foo.Is-Bar_` is a valid parameter name, but `barIsBa$` or `0banana` are not. Each declared parameter has a `type` field, which can be set to either `array` or `string`. `array` is useful in cases where the number of compilation flags being supplied to a task varies throughout the `Task's` execution. If not specified, the `type` field defaults to @@ -478,7 +478,14 @@ spec: steps: - name: build image: my-builder - args: ["build", "$(params.flags[*])", "url=$(params.someURL)"] + args: [ + "build", + "$(params.flags[*])", + # It would be equivalent to use $(params["someURL"]) here, + # which is necessary when the parameter name contains '.' + # characters (e.g. `$(params["some.other.URL"])`) + 'url=$(params.someURL)', + ] ``` The following `TaskRun` supplies a dynamic number of strings within the `flags` parameter: @@ -790,6 +797,8 @@ variable values as follows: - To reference a parameter in a `Task`, use the following syntax, where `` is the name of the parameter: ```shell $(params.) + # or subscript form: + $(params[""]) ``` - To access parameter values from resources, see [variable substitution](resources.md#variable-substitution) diff --git a/docs/variables.md b/docs/variables.md index bfbd7abd1e7..e831007751d 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -17,7 +17,9 @@ For instructions on using variable substitutions see the relevant section of [th | Variable | Description | | -------- | ----------- | | `params.` | The value of the parameter at runtime. | +| `params[""]` | (see above) | | `tasks..results.` | The value of the `Task's` result. Can alter `Task` execution order within a `Pipeline`.) | +| `tasks..results[""]` | (see above)) | | `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if the `Workspace` declaration has `optional: true` and the Workspace binding was omitted by the PipelineRun. | | `context.pipelineRun.name` | The name of the `PipelineRun` that this `Pipeline` is running in. | | `context.pipelineRun.namespace` | The namespace of the `PipelineRun` that this `Pipeline` is running in. | @@ -32,9 +34,11 @@ For instructions on using variable substitutions see the relevant section of [th | Variable | Description | | -------- | ----------- | | `params.` | The value of the parameter at runtime. | +| `params[""]` | (see above) | | `resources.inputs..path` | The path to the input resource's directory. | | `resources.outputs..path` | The path to the output resource's directory. | | `results..path` | The path to the file where the `Task` writes its results data. | +| `results[""].path` | (see above) | | `workspaces..path` | The path to the mounted `Workspace`. Empty string if an optional `Workspace` has not been provided by the TaskRun. | | `workspaces..bound` | Whether a `Workspace` has been bound or not. "false" if an optional`Workspace` has not been provided by the TaskRun. | | `workspaces..claim` | The name of the `PersistentVolumeClaim` specified as a volume source for the `Workspace`. Empty string for other volume types. |