How can I always ensure that an action of Kind Run...
# 🤖|ask-kapa
f
@microscopic-river-74022 How can I always ensure that an action of Kind Run and type exec logs output during
deploy --sync
?
m
Please stand by @fresh-yak-35965 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- To ensure that an action of Kind Run and type exec logs output during
deploy --sync
, you can use the
${actions.run.<name>.outputs.log}
template string key. This key provides the full log output from the executed command. Here is an example of how you can use it:
Copy code
yaml
kind: Run
type: exec
name: get-api-hash
spec:
  command: [git, rev-parse, HEAD]
---
kind: Deploy
type: container
name: api
dependencies: [run.get-api-hash]
spec:
  # ...
  env:
    COMMIT_HASH: ${actions.run.get-api-hash.outputs.log}
In this example, the
get-api-hash
Run action executes the
git rev-parse HEAD
command, and its output is stored in the
COMMIT_HASH
environment variable of the
api
Deploy action. Remember to make the log output machine-readable so it can be parsed by dependants. Also, note that you can stream logs for a
Deploy
action using the
garden logs my-deploy --follow
command. For more information, refer to the Garden documentation on exec Run Outputs () and Garden documentation on streaming logs for a Deploy action (). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
f
@microscopic-river-74022 I just want to make sure that when Garden runs my Run actions they display the stdout/stderr to the garden console.
m
Let me check the knowledge base for you. One moment! :books:
---------------------- Garden should automatically display the stdout and stderr of your Run actions in the console. However, if you're experiencing issues with this, it could be due to a variety of factors. One possible issue could be related to the length of your output. As mentioned in a Discord support thread (), a user reported that Garden was cutting off their output in the middle of a long unit test. If you're experiencing a similar issue, it might be worth reaching out to the Garden community for support. If you're not seeing any output at all, it could be due to how your Run actions are configured. You might want to review the Garden documentation on exec Run Outputs () to ensure your actions are set up correctly. Remember, you can also use the
garden logs my-deploy --follow
command to stream logs for a
Deploy
action, which might help you troubleshoot any issues you're experiencing. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
2 Views