-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change adds easier Make directives to enter and exit development mode, where you can use any Terraform plan to test the built provider. It also adds a `help` directive that looks like: ``` $ make help lint Runs go linter generate Generate or update documentation fmt Runs go formatter dev/enter Updates the terraformrc to point to the DEV_BIN_PATH. Installs the provider to the DEV_BIN_PATH dev/exit Removes development provider package from DEV_BIN_PATH write-terraform-rc Write to terraformrc file to mirror mondoohq/mondoo to DEV_BIN_PATH remove-terraform-rc Remove the terraformrc file help Show this help test Runs go tests hcl/fmt Runs terraform formatter hcl/lint Runs terraform linter ``` Signed-off-by: Salim Afiune Maya <[email protected]>
- Loading branch information
Showing
4 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
example.tf | ||
terraform.tfplan | ||
terraform.tfstate | ||
.terraform.lock.hcl | ||
bin/ | ||
dist/ | ||
modules-dev/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# create a .terraformrc file only if the file is not present | ||
write_terraform_rc() { | ||
if [[ -f "$HOME/.terraformrc" ]]; then | ||
return 0 | ||
fi | ||
|
||
cat > "$HOME/.terraformrc" << EOL | ||
provider_installation { | ||
filesystem_mirror { | ||
path = "$HOME/.terraform.d/plugins" | ||
include = ["mondoohq/mondoo"] | ||
} | ||
direct { | ||
exclude = ["mondoohq/mondoo"] | ||
} | ||
} | ||
EOL | ||
} | ||
|
||
write_terraform_rc "$@" || exit 99 |