aztfmod / rovergo

The next version of Rover, the command line tool for Azure CAF Landingzones. Developed in Go
MIT License
10 stars 7 forks source link

Switch custom actions to being a single file #123

Closed benc-uk closed 3 years ago

benc-uk commented 3 years ago

As a side effect of the work on #109 and #122 it has been decided to change the design of custom actions

Instead of a directory containing multiple YAML files, a single YAML file is used. This simplifies the code significantly, it is also felt this will give an easier/better user experience also.

The file used resides in the $HOME/.rover/ directory and is named actions.yaml. When rover starts this file is checked, if it doesn't exist a default is created, see pkg/custom/default_actions.yaml Note: The contents of this default file are embedded into the rover binary at build time

Example of actions.yaml Note there is no longer a need for a name: field, the YAML key is used as the action name

finder:
  executable: "find"
  description: "List all terraform (example custom action)"
  arguments: ["{{SOURCE_DIR}}", "-name", "*.tf"]

lint:
  executable: "tflint"
  description: "A linter for terraform"
  arguments: ["{{SOURCE_DIR}}", "--enable-rule=terraform_comment_syntax"]

All other functionality remains the same