Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename command graph to run-graph #2946

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/commands/graph/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

const (
CommandName = "graph"
CommandName = "run-graph"
)

func NewFlags(opts *options.TerragruntOptions) cli.Flags {
Expand Down
12 changes: 6 additions & 6 deletions docs/_docs/04_reference/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Terragrunt supports the following CLI commands:
- [output-module-groups](#output-module-groups)
- [scaffold](#scaffold)
- [catalog](#catalog)
- [graph](#graph)
- [run-graph](#run-graph)

### All Terraform built-in commands

Expand Down Expand Up @@ -529,7 +529,7 @@ Launch the user interface for searching and managing your module catalog.

More details in [catalog section](https://terragrunt.gruntwork.io/docs/features/catalog/).

### graph
### run-graph

Run the provided terraform command against the graph of dependencies for the module in the current working directory. The graph consists of all modules that depend on the module in the current working directory via a `depends_on` or `dependencies` block, plus all the modules that depend on those modules, and all the modules that depend on those modules, and so on, recursively up the tree, up to the Git repository root, or the path specified via the optional `--graph-root` argument.

Expand All @@ -539,7 +539,7 @@ Example:
Having bellow dependencies:
[![dependency-graph](/assets/img/collections/documentation/dependency-graph.png){: width="80%" }]({{site.baseurl}}/assets/img/collections/documentation/dependency-graph.png)

Running `terragrunt graph apply` in `eks` module will lead to the following execution order:
Running `terragrunt run-graph apply` in `eks` module will lead to the following execution order:
```
Group 1
- Module project/eks
Expand All @@ -564,7 +564,7 @@ Notes:
* `lambda` modules aren't included in the graph, because they are not dependent on `eks` module.
* execution is from bottom up based on dependencies

Running `terragrunt graph destroy` in `eks` module will lead to the following execution order:
Running `terragrunt run-graph destroy` in `eks` module will lead to the following execution order:
```
Group 1
- Module project/services/eks-service-2-v2
Expand All @@ -589,7 +589,7 @@ Notes:
* execution is in reverse order, first are destroyed "top" modules and in the end `eks`
* `lambda` modules aren't affected at all

Running `terragrunt graph apply` in `services/eks-service-3`:
Running `terragrunt run-graph apply` in `services/eks-service-3`:
```
Group 1
- Module project/services/eks-service-3
Expand All @@ -605,7 +605,7 @@ Group 3
Notes:
* in execution are included only services dependent from `eks-service-3`

Running `terragrunt graph destroy` in `services/eks-service-3`:
Running `terragrunt run-graph destroy` in `services/eks-service-3`:
```
Group 1
- Module project/services/eks-service-3-v3
Expand Down
6 changes: 3 additions & 3 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6582,7 +6582,7 @@ func TestTerragruntDestroyGraph(t *testing.T) {
stdout := bytes.Buffer{}
stderr := bytes.Buffer{}

err := runTerragruntCommand(t, fmt.Sprintf("terragrunt graph destroy --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
err := runTerragruntCommand(t, fmt.Sprintf("terragrunt run-graph destroy --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
assert.NoError(t, err)
output := fmt.Sprintf("%v\n%v\n", stdout.String(), stderr.String())

Expand Down Expand Up @@ -6632,7 +6632,7 @@ func TestTerragruntApplyGraph(t *testing.T) {
stdout := bytes.Buffer{}
stderr := bytes.Buffer{}

err := runTerragruntCommand(t, fmt.Sprintf("terragrunt graph apply --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
err := runTerragruntCommand(t, fmt.Sprintf("terragrunt run-graph apply --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
assert.NoError(t, err)
output := fmt.Sprintf("%v\n%v\n", stdout.String(), stderr.String())

Expand All @@ -6656,7 +6656,7 @@ func TestTerragruntGraphNonTerraformCommandExecution(t *testing.T) {
stdout := bytes.Buffer{}
stderr := bytes.Buffer{}

err := runTerragruntCommand(t, fmt.Sprintf("terragrunt graph render-json --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
err := runTerragruntCommand(t, fmt.Sprintf("terragrunt run-graph render-json --terragrunt-non-interactive --terragrunt-working-dir %s --terragrunt-graph-root %s", tmpModulePath, tmpEnvPath), &stdout, &stderr)
assert.NoError(t, err)

// check that terragrunt_rendered.json is created in mod1/mod2/mod3
Expand Down