Skip to content

Commit

Permalink
Cleanup for release 0.7.0 (#54)
Browse files Browse the repository at this point in the history
Co-authored-by: dmattia <david@transcend.io>
  • Loading branch information
dmattia and dmattia authored Sep 3, 2020
1 parent 835cc96 commit 7f2c726
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.6.0
VERSION=0.7.0
PATH_BUILD=build/
FILE_COMMAND=terragrunt-atlantis-config
FILE_ARCH=darwin_amd64
Expand Down
36 changes: 10 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## What is this?

[Atlantis](runatlantis.io) is an awesome tool for Terraform pull request automation. Each repo can have a YAML config file that defines Terraform module dependendcies, so that PRs that affect dependent modules will automatically generate `terraform plan`s for those modules.
[Atlantis](runatlantis.io) is an awesome tool for Terraform pull request automation. Each repo can have a YAML config file that defines Terraform module dependencies, so that PRs that affect dependent modules will automatically generate `terraform plan`s for those modules.

[Terragrunt](https://terragrunt.gruntwork.io) is a Terraform wrapper, which has the concept of dependencies built into its configuration.

Expand Down Expand Up @@ -148,42 +148,26 @@ jobs:
id: atlantis_validator
uses: transcend-io/terragrunt-atlantis-config-github-action@v0.0.3
with:
version: v0.6.0
version: v0.7.0
extra_args: '--autoplan --parallel=false
```

You can customize the version and flags you typically pass to the `generate` command in those final two lines.

## Separate workspace for parallel plan and apply

Atlantis added support for running plan and apply parallel in [v0.13.0](https://github.com/runatlantis/atlantis/releases/tag/v0.13.0).
To use this feature, projects has to be separated in different workspaces,
`createWorkspace` flag enables this by concatenating the project path as the
name of the workspace, eg: project `${git_root}/stage/app/terragrunt.hcl` will
have the name `stage_app` as workspace name. This flag needs to be used along with
`parallel` to enable parallel plan and apply:

```
terragrunt-atlantis-config generate --output atlantis.yaml --ignore-parent-terragrunt --workflow terragrunt --autoplan=false --parallel=true --createWorkspace=true
automerge: false
parallel_apply: true
parallel_plan: true
projects:
- autoplan:
enabled: false
when_modified:
- '*.hcl'
dir: stage/app
workflow: terragrunt
workspace: stage_app
```
To use this feature, projects have to be separated in different workspaces, and the `create-workspace` flag enables this by concatenating the project path as the
name of the workspace.

---
***NOTE:***
As an example, project `${git_root}/stage/app/terragrunt.hcl` will have the name `stage_app` as workspace name. This flag should be used along with `parallel` to enable parallel plan and apply:

Enable this feature may consume more resources like cpu, memory, network and disk,
as multiple projects are being processed at the same time.
```bash
terragrunt-atlantis-config generate --output atlantis.yaml --parallel --create-workspace
```

---
Enabling this feature may consume more resources like cpu, memory, network, and disk, as each workspace will now be cloned separately by atlantis.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func init() {
generateCmd.PersistentFlags().BoolVar(&autoPlan, "autoplan", false, "Enable auto plan. Default is disabled")
generateCmd.PersistentFlags().BoolVar(&ignoreParentTerragrunt, "ignore-parent-terragrunt", false, "Ignore parent terragrunt configs (those which don't reference a terraform module). Default is disabled")
generateCmd.PersistentFlags().BoolVar(&parallel, "parallel", true, "Enables plans and applys to happen in parallel. Default is enabled")
generateCmd.PersistentFlags().BoolVar(&createWorkspace, "createWorkspace", false, "Use different workspace for each project. Default is use default workspace")
generateCmd.PersistentFlags().BoolVar(&createWorkspace, "create-workspace", false, "Use different workspace for each project. Default is use default workspace")
generateCmd.PersistentFlags().StringVar(&defaultWorkflow, "workflow", "", "Name of the workflow to be customized in the atlantis server. Default is to not set")
generateCmd.PersistentFlags().StringVar(&outputPath, "output", "", "Path of the file where configuration will be generated. Default is not to write to file")
generateCmd.PersistentFlags().StringVar(&gitRoot, "root", pwd, "Path to the root directory of the github repo you want to build config for. Default is current dir")
Expand Down
2 changes: 1 addition & 1 deletion cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@ func TestWithWorkspaces(t *testing.T) {
runTest(t, filepath.Join("golden", "withWorkspace.yaml"), []string{
"--root",
filepath.Join("..", "test_examples", "basic_module"),
"--createWorkspace=true",
"--create-workspace",
})
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import "github.com/transcend-io/terragrunt-atlantis-config/cmd"

var (
VERSION = "0.6.0"
VERSION = "0.7.0"
)

func main() {
Expand Down

0 comments on commit 7f2c726

Please sign in to comment.