mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
feat: Add examples to --help output for "generate-spec PROJECT" (#15871)
* feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * Update app.go Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * Update argocd_app_get.md Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat: Add examples to --help output for all "argocd proj" cmds (#15824) Signed-off-by: Michele Caci <michele.caci@gmail.com> Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * chore(deps): bump gitops-engine (#15736) * chore(deps): bump gitops-engine Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * go mod tidy Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com> Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add example to argocd relogin command (#15839) * feat: Add example to argocd relogin command Signed-off-by: Chiranjeevi R <chiranjeevi.ramanatha@gmail.com> * feat: Add example to argocd relogin command Signed-off-by: Chiranjeevi R <chiranjeevi.ramanatha@gmail.com> * correc --sso flag Signed-off-by: Chiranjeevi R <chiranjeevi.ramanatha@gmail.com> * Apply suggestions from code review Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Chiranjeevi R <chiranjeevi.ramanatha@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * test(e2e): allow build of argocd-e2e-cluster image for remote tests (#15805) * chore: allow build of argocd-e2e-cluster image for remote testing Signed-off-by: Chris Fry <christopherfry@google.com> * Retrigger CI pipeline Signed-off-by: Chris Fry <christopherfry@google.com> --------- Signed-off-by: Chris Fry <christopherfry@google.com> Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat: Add examples to --help output for get APPNAME Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * Update app.go Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * Update argocd_app_get.md Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * feat(cli): Add examples to --help output for generate-spec PROJECT Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> * docs: clarify health inheritance (#15799) * docs: resource health inheritance Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * write more better Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> --------- Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com> Signed-off-by: Michele Caci <michele.caci@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: Chiranjeevi R <chiranjeevi.ramanatha@gmail.com> Signed-off-by: Chris Fry <christopherfry@google.com> Co-authored-by: Michele Caci <michele.caci@gmail.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Ishita Sequeira <46771830+ishitasequeira@users.noreply.github.com> Co-authored-by: Chiranjeevi R <96932059+chiranjeevir-git@users.noreply.github.com> Co-authored-by: Christopher Fry <ChristopherFry2008@gmail.com>
This commit is contained in:
parent
6a48b13711
commit
9330d3a962
2 changed files with 25 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import (
|
|||
"github.com/argoproj/argo-cd/v2/util/cli"
|
||||
"github.com/argoproj/argo-cd/v2/util/errors"
|
||||
"github.com/argoproj/argo-cd/v2/util/io"
|
||||
"github.com/argoproj/argo-cd/v2/util/templates"
|
||||
|
||||
"github.com/argoproj/gitops-engine/pkg/utils/kube"
|
||||
"github.com/spf13/cobra"
|
||||
|
|
@ -47,6 +48,17 @@ func NewGenProjectSpecCommand() *cobra.Command {
|
|||
var command = &cobra.Command{
|
||||
Use: "generate-spec PROJECT",
|
||||
Short: "Generate declarative config for a project",
|
||||
Example: templates.Examples(`
|
||||
# Generate a YAML configuration for a project named "myproject"
|
||||
argocd admin projects generate-spec myproject
|
||||
|
||||
# Generate a JSON configuration for a project named "anotherproject" and specify an output file
|
||||
argocd admin projects generate-spec anotherproject --output json --file config.json
|
||||
|
||||
# Generate a YAML configuration for a project named "someproject" and write it back to the input file
|
||||
argocd admin projects generate-spec someproject --inline
|
||||
`),
|
||||
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
proj, err := cmdutil.ConstructAppProj(fileURL, args, opts, c)
|
||||
errors.CheckError(err)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,19 @@ Generate declarative config for a project
|
|||
argocd admin proj generate-spec PROJECT [flags]
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# Generate a YAML configuration for a project named "myproject"
|
||||
argocd admin projects generate-spec myproject
|
||||
|
||||
# Generate a JSON configuration for a project named "anotherproject" and specify an output file
|
||||
argocd admin projects generate-spec anotherproject --output json --file config.json
|
||||
|
||||
# Generate a YAML configuration for a project named "someproject" and write it back to the input file
|
||||
argocd admin projects generate-spec someproject --inline
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue