argocdapp Plugin

This plugin creates an ArgoCD Application custom resource.

Notes: - ArgoCD itself must have been already installed before the usage of this plugin. To install ArgoCD, use the argocd plugin. Or you can use both plugins(argocd+argocdapp) at the same time. See GitOps Toolchain for more info. - Currently, only the Helm chart is supported when creating the ArgoCD application. - Modify the file accordingly. Especially remember to modify ARGOCD_TOOL_NAME.

Usage

  1. tools:
  2. # name of the tool
  3. - name: argocdapp
  4. # id of the tool instance
  5. instanceID: default
  6. # format: name.instanceID; If specified, dtm will make sure the dependency is applied first before handling this tool.
  7. dependsOn: [ "argocd.ARGOCD_INSTANCE_NAME" ]
  8. # options for the plugin
  9. options:
  10. # information on the ArgoCD Application
  11. app:
  12. # name of the ArgoCD Application
  13. name: hello
  14. # where the ArgoCD Application custom resource will be created
  15. namespace: argocd
  16. # destination of the ArgoCD Application
  17. destination:
  18. # on which server to deploy
  19. server: https://kubernetes.default.svc
  20. # in which namespace to deploy
  21. namespace: default
  22. # source of the application
  23. source:
  24. # which values file to use in the Helm chart
  25. valuefile: values.yaml
  26. # path of the Helm chart
  27. path: charts/go-hello-http
  28. # Helm chart repo URL, this is only an example, do not use this
  29. repoURL: YOUR_CHART_REPO_URL

Use Together with the github-repo-scaffolding-golang Plugin

This plugin can be used together with the github-repo-scaffolding-golang plugin (see document here.)

For example, you can first use github-repo-scaffolding-golang to bootstrap a Golang repo, then use this plugin to set up basic GitHub Actions CI workflows. In this scenario:

  • This plugin can specify github-repo-scaffolding-golang as a dependency, so that the dependency is first satisfied before executing this plugin.
  • This plugin can refer to github-repo-scaffolding-golang‘s output to reduce copy/paste human error.

See the example below:

  1. ---
  2. tools:
  3. - name: go-webapp-repo
  4. plugin: github-repo-scaffolding-golang
  5. options:
  6. owner: IronCore864
  7. repo: go-webapp-devstream-demo
  8. branch: main
  9. image_repo: ironcore864/go-webapp-devstream-demo
  10. - name: go-webapp-argocd-deploy
  11. plugin: argocdapp
  12. dependsOn: ["go-webapp-repo.github-repo-scaffolding-golang"]
  13. options:
  14. app:
  15. name: hello
  16. namespace: argocd
  17. destination:
  18. server: https://kubernetes.default.svc
  19. namespace: default
  20. source:
  21. valuefile: values.yaml
  22. path: charts/go-hello-http
  23. repoURL: ${{go-webapp-repo.github-repo-scaffolding-golang.outputs.repoURL}}

In the example above:

  • We put go-webapp-repo.github-repo-scaffolding-golang as dependency by using the dependsOn keyword.
  • We used go-webapp-repo.github-repo-scaffolding-golang‘s output as input for the githubactions-golang plugin.

Pay attention to the ${{ xxx }} part in the example. ${{ TOOL_NAME.PLUGIN.outputs.var}} is the syntax for using an output.