Output

Introduction

In DevStream’s configuration file, we can use Output from one Tool as the options values for another Tool.

For example, if Tool A has an output, we can use its value as Tool B’s options.

Notes:

  • At the moment, B using A’s output doesn’t mean B “depends on” A.
  • If B really needs to “depend on” A, i.e., we want to make sure A runs first before B runs, we still need to use the dependsOn keyword (see the previous section “Core Concepts“ for more details.)

Syntax

To use the output, follow this format:

  1. ${{ TOOL_NAME.TOOL_INSTANCE_ID.outputs.OUTPUT_KEY }}

For example, given config:

  1. tools:
  2. - name: trello
  3. instanceID: default
  4. options:
  5. owner: IronCore864
  6. repo: golang-demo
  7. kanbanBoardName: golang-demo-board
  • TOOL_NAME is “trello”
  • TOOL_INSTANCE_ID is “default”

If the “trello” tool/plugin has an output key name “boardId”, then we can use its value by the following syntax:

  1. ${{ trello.default.outputs.boardId }}

Real-World Usage Example

Config:

  1. ---
  2. tools:
  3. - name: github-repo-scaffolding-golang
  4. instanceID: default
  5. options:
  6. owner: IronCore864
  7. repo: golang-demo
  8. branch: main
  9. image_repo: ironcore864/golang-demo
  10. - name: argocd
  11. instanceID: default
  12. options:
  13. create_namespace: true
  14. repo:
  15. name: argo
  16. url: https://argoproj.github.io/argo-helm
  17. chart:
  18. chart_name: argo/argo-cd
  19. release_name: argocd
  20. namespace: argocd
  21. wait: true
  22. timeout: 10m
  23. upgradeCRDs: true
  24. - name: argocdapp
  25. instanceID: default
  26. dependsOn: [ "argocd.default", "github-repo-scaffolding-golang.default" ]
  27. options:
  28. app:
  29. name: golang-demo
  30. namespace: argocd
  31. destination:
  32. server: https://kubernetes.default.svc
  33. namespace: default
  34. source:
  35. valuefile: values.yaml
  36. path: helm/golang-demo
  37. repoURL: ${{ github-repo-scaffolding-golang.default.outputs.repoURL }} # pay attention here

In this example: - The “default” instance of tool argocdapp depends on the “default” instance of tool github-repo-scaffolding-golang - The “default” instance of tool argocdapp has an user option “options.source.repoURL”, which uses the “default” instance of tool github-repo-scaffolding-golang‘s output “repoURL” (${{ github-repo-scaffolding-golang.default.outputs.repoURL }})