Skip to content

Commit

Permalink
Merge pull request #76 from JackFlukinger/JackFlukinger
Browse files Browse the repository at this point in the history
Nested Modules and SVG Image Generation in CLI
  • Loading branch information
im2nguyen authored Jan 11, 2022
2 parents 5661c90 + cf65650 commit 2eaa45b
Show file tree
Hide file tree
Showing 35 changed files with 4,886 additions and 7,327 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ WORKDIR /src
# Copy specific package files
COPY ./ui/package-lock.json ./
COPY ./ui/package.json ./
COPY ./ui/babel.config.js ./
# Set Progress, Config and install
RUN npm set progress=false && npm config set depth 0 && npm install
# Copy source
Expand Down Expand Up @@ -35,6 +36,9 @@ RUN cp /bin/terraform /usr/local/bin/terraform
COPY --from=rover /src/rover /bin/rover
RUN chmod +x /bin/rover

# Install Google Chrome
RUN apk add chromium

WORKDIR /src

ENTRYPOINT [ "/bin/rover" ]
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,22 @@ Then, add it as environment variables to your Docker container with `--env-file`
$ docker run --rm -it -p 9000:9000 -v $(pwd):/src --env-file ./.env im2nguyen/rover
```

## Define tfbackend, tfvars and Terraform variables
### Define tfbackend, tfvars and Terraform variables

Use `-tfBackendConfig` to define backend config files and `-tfVarsFile` or `-tfVar` to define variables. For example, you can run the following in the `example/random-test` directory to overload variables.

```
$ docker run --rm -it -p 9000:9000 -v $(pwd):/src im2nguyen/rover -tfBackendConfig test.tfbackend -tfVarsFile test.tfvars -tfVar max_length=4
```

### Image generation

Use `-genImage` to generate and save the visualization as a SVG image.

```
$ docker run --rm -it -v $(pwd):/src im2nguyen/rover -genImage true
```

## Installation

You can download Rover binary specific to your system by visiting the [Releases page](https://github.com/im2nguyen/rover/releases). Download the binary, unzip, then move `rover` into your `PATH`.
Expand Down Expand Up @@ -157,3 +165,4 @@ $ rover -workingDir "example/eks-cluster" -tfPath "/Users/dos/terraform"
```

Once Rover runs on `0.0.0.0:9000`, navigate to it to find the visualization!

7 changes: 5 additions & 2 deletions example/random-test/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,39 @@ module rover
go 1.17

require (
github.com/chromedp/cdproto v0.0.0-20211205231339-d2673e93eee4
github.com/chromedp/chromedp v0.7.6
github.com/hashicorp/terraform-config-inspect v0.0.0-20210511202847-ad33d83d7650
github.com/hashicorp/terraform-exec v0.15.0
github.com/hashicorp/terraform-json v0.13.0
golang.org/x/net v0.0.0-20210924151903-3ad01bbaa167 // indirect
)

require github.com/hashicorp/go-tfe v0.20.0

require (
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg v1.0.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/hashicorp/go-slug v0.7.0 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f // indirect
github.com/hashicorp/hcl/v2 v2.0.0 // indirect
github.com/hashicorp/jsonapi v0.0.0-20210826224640-ee7dae0fb22d // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/zclconf/go-cty v1.9.1 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
)
Loading

0 comments on commit 2eaa45b

Please sign in to comment.