-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See: #633
- Loading branch information
Showing
6 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...-services/concourse-language-server/src/main/resources/desc/LoadVarStep/file.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*Required*. The path to a file whose content shall be read and used as the var's value. |
35 changes: 35 additions & 0 deletions
35
...ervices/concourse-language-server/src/main/resources/desc/LoadVarStep/format.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*Optional*. The format of the file's content. | ||
|
||
If unset, Concourse will try to detect the format from the file extension. If the file format cannot be determined, Concourse will fallback to `trim`. | ||
|
||
If set to `json`, `yaml`, or `yml`, the file content will be parsed accordingly and the resulting structure will be the value of the var. | ||
|
||
If set to `trim`, the var will be set to the content of the file with any trailing and leading whitespace removed. | ||
|
||
If set to `raw`, the var will be set to the content of the file without modification (i.e. with any existing whitespace). | ||
|
||
**Example**: Loading a var with multiple fields. | ||
|
||
Let's say we have a task, `generate-creds`, which produces a `generated-user` output containing a `user.json` file like so: | ||
|
||
``` | ||
{ | ||
"username": "some-user", | ||
"password": "some-password" | ||
} | ||
``` | ||
|
||
We could pass these credentials to subsequent steps by loading it into a var with `load_var`, which will detect that it is in JSON format based on the file extension: | ||
|
||
``` | ||
plan: | ||
- task: generate-creds | ||
- load_var: user | ||
file: generated-user/user.json | ||
- task: use-creds | ||
params: | ||
USERNAME: ((.:user.username)) | ||
PASSWORD: ((.:user.password)) | ||
``` | ||
|
||
If the `use-creds` task were to print these values, they would be automatically redacted unless `reveal: true` is set. |
14 changes: 14 additions & 0 deletions
14
...vices/concourse-language-server/src/main/resources/desc/LoadVarStep/load_var.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Note: The `load_var` step was introduced in Concourse v6.0.0. It is considered an experimental feature until its associated [RFC](https://github.com/concourse/rfcs/pull/27) is resolved. | ||
|
||
*Required* Load the value for a var at runtime, making it available to subsequent steps as a build-local var named after the given identifier. | ||
|
||
The following build plan uses a version produced by the semver resource as a tag: | ||
|
||
``` | ||
plan: | ||
- get: version | ||
- load_var: version-tag | ||
file: version/version | ||
- put: image | ||
params: {tag: ((.:version-tag))} | ||
``` |
1 change: 1 addition & 0 deletions
1
...ervices/concourse-language-server/src/main/resources/desc/LoadVarStep/reveal.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*Optional*. *Default: false*. If set to `true`, allow the var's content to be printed in the build output even with secret redaction enabled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters