Skip to content

Commit

Permalink
docs(gitops): adding dependency logic in gitops.md
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hu <[email protected]>
  • Loading branch information
daniel-hutao committed Mar 19, 2022
1 parent b6f61f2 commit a32e7c2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
20 changes: 15 additions & 5 deletions docs/best_practices/gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

## Plugins needed

1. github-repo-scaffolding-golang
2. jira-github
3. githubactions-golang
4. argocd
5. argocdapp
1. [github-repo-scaffolding-golang](../plugins/github-repo-scaffolding-golang_plugin.md)
2. [jira-github](../plugins/jira-github-integ_plugin.md)
3. [githubactions-golang](../plugins/githubactions-golang_plugin.md)
4. [argocd](../plugins/argocd_plugin.md)
5. [argocdapp](../plugins/argocdapp_plugin.md)

The dependencies of these plugins are(`a -> b` means for `a depends on b`):

- `jira-github` -> `github-repo-scaffolding-golang`
- `githubactions-golang` -> `github-repo-scaffolding-golang`
- `argocdapp` -> `argocd`

Note: These dependencies are not consistent, such as when the repo operated by `jira-github` and `github-repo-scaffolding-golang` are not the same, the dependencies disappear.

We should use the `dependency` according to the actual usage situation.

## Download DevStream (`dtm`)

Expand Down
12 changes: 7 additions & 5 deletions docs/plugins/argocdapp_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
This plugin creates an [ArgoCD Application](https://argo-cd.readthedocs.io/en/stable/core_concepts/) custom resource.

**Notes:**
- ArgoCD itself must have been already installed before the usage of this plugin. To install ArgoCD, use the [argocd plugin](https://github.com/merico-dev/stream/blob/main/docs/argocd_plugin.md).
- ArgoCD itself must have been already installed before the usage of this plugin.
To install ArgoCD, use the [argocd plugin](https://github.com/merico-dev/stream/blob/main/docs/argocd_plugin.md).
Or you can use both plugins(argocd+argocdapp) at the same time.
See [GitOps Toolchain](../best_practices/gitops.md) for more info.
- Currently, only the Helm chart is supported when creating the ArgoCD application.
- At the moment, DevStream doesn't support dependency or concurrency yet. So, in the config file, the ArgoCD app plugin must be placed _after_ the ArgoCD plugin if you want to install ArgoCD first then create the ArgoCD application.

- Modify the file accordingly. Especially remember to modify `ARGOCD_INSTANCE_NAME`.
## 2 Usage:

```yaml
Expand All @@ -18,8 +20,8 @@ tools:
# version of the plugin
# checkout the version from the GitHub releases
version: 0.2.0
# optional; if specified, dtm will make sure the dependency is applied first before handling this tool.
dependsOn: [ "TOOL1_NAME.TOOL1_KIND", "TOOL2_NAME.TOOL2_KIND" ]
# if specified, dtm will make sure the dependency is applied first before handling this tool.
dependsOn: [ "ARGOCD_INSTANCE_NAME.argocd" ]
# options for the plugin
options:
# information on the ArgoCD Application
Expand Down
8 changes: 7 additions & 1 deletion examples/gitops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ tools:
# version of the plugin
# checkout the version from the GitHub releases
version: 0.2.0
# optional; if specified, dtm will make sure the dependency is applied first before handling this tool.
dependsOn: [ "go-webapp-repo.github-repo-scaffolding-golang" ]
# options for the plugin
options:
# the repo's owner
Expand All @@ -45,6 +47,8 @@ tools:
# version of the plugin
# checkout the version from the GitHub releases
version: 0.2.0
# optional; if specified, dtm will make sure the dependency is applied first before handling this tool.
dependsOn: [ "go-webapp-repo.github-repo-scaffolding-golang" ]
# options for the plugin
options:
# the repo's owner. It should be case-sensitive here; strictly use your GitHub user name; please change the value below.
Expand Down Expand Up @@ -79,7 +83,7 @@ tools:
enable: False
# dockerhub image repo; please change the value below.
repo: YOUR_DOCKERHUB_IMAGE_REPO_NAME
- name: argocd
- name: argocd-dev
plugin:
# name of the plugin
kind: argocd
Expand Down Expand Up @@ -115,6 +119,8 @@ tools:
# version of the plugin
# checkout the version from the GitHub releases
version: 0.2.0
# if specified, dtm will make sure the dependency is applied first before handling this tool.
dependsOn: [ "argocd-dev.argocd" ]
# options for the plugin
options:
# information on the ArgoCD application
Expand Down

0 comments on commit a32e7c2

Please sign in to comment.