quaint-printer-97061
07/26/2024, 11:52 AMmicroscopic-river-74022
07/26/2024, 11:52 AMmicroscopic-river-74022
07/26/2024, 11:52 AMactions.<kind>.<name>.outputs.. They are resolved later than other template strings, which means you cannot use them for some fields, such as most identifiers, because those need to be resolved before validating the configuration.
Here's an example of how you can pass log outputs from one task to another:
yaml
kind: Run
type: exec
name: prep-run
spec:
command: [echo, "my run output"]
---
kind: Deploy
name: my-deploy
dependencies: [run.prep-run]
spec:
env:
PREP_TASK_OUTPUT: ${actions.run.prep-run.outputs.log} # <- resolves to "my task output"
In this example, the output from prep-run is copied to an environment variable for my-deploy. Note that you currently need to explicitly declare prep-run as a dependency for this to work.
Different action types expose different outputs. For exec action, you can use the following keys:
- `${actions.run..name}`: The name of the action.
- `${actions.run..disabled}`: Whether the action is disabled.
- `${actions.run..buildPath}`: The local path to the action build directory.
- `${actions.run..sourcePath}`: The local path to the action source directory.
- `${actions.run..mode}`: The mode that the action should be executed in.
- `${actions.run..var.*}`: The variables configured on the action.
- `${actions.run..outputs.log}`: The full log output from the executed command.
For more details, please refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
07/26/2024, 11:52 AMquaint-printer-97061
07/26/2024, 11:59 AMkind: Run
type: exec
name: dependency-update
varfiles:
- dependencies.yaml
spec:
command: []
outputs:
$forEach: ${variables.dependencies}
$return:
- name: "dependencies.${item.value.name}"
value: "${item.value.name}-${item.value.version}.tgz"
But outputs is not a valid key
Then, in the next Action I want to consume that as something like ${action.run.dependency-update.outputs.*}microscopic-river-74022
07/26/2024, 11:59 AMmicroscopic-river-74022
07/26/2024, 12:00 PMRun action spec. The outputs key is not a valid key in the Run action spec.
The outputs key is used in the project configuration to define project outputs that can be resolved and retrieved using the garden get outputs command. Here's an example:
yaml
apiVersion: garden.io/v1
kind: Project
name: my-project
...
outputs:
my-action-image: ${actions.build.my-image.outputs.deployment-image-id}
In this example, my-action-image is a project output that can be retrieved with the garden get outputs command.
However, this does not allow you to define custom outputs in a Run action that can be consumed in a subsequent action. The available outputs for a Run action are predefined and include the full log output from the executed command (${actions.run.<name>.outputs.log}), among others.
For more details, please refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
07/26/2024, 12:00 PM