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

load commands yml file and validates it #133

Closed polatengin closed 3 years ago

polatengin commented 3 years ago

With the changes, rovergo now loads commands.yaml file if it finds it in the current working directory or in the rover home directory

It validates the custom commands and groups structures by

Fixes,

To check if the changes are working; I created commands.yaml file at the root of the project with the following content;

commands:
  format:
    executableName: "terraform"
    subCommand: "fmt"
    flags: "-no-color -recursive -check -diff"
    debug: false
    requiresInit: false
    parameters:
      - name: list
        value: true
        prefix: "-"
      - name: write
        value: false
        prefix: "-"
  format2:
    executableName: "terraform"
    subCommand: "fmt"
    flags: "-no-color -recursive -check -diff"
    debug: false
    requiresInit: false
    parameters:
      - name: list
        value: true
        prefix: "-"
      - name: write
        value: false
        prefix: "-"

groups:
  deploy:
    - format
    - foo
    - plan
    - apply
    - test
  validate:
    - plan
    - apply
    - security
    - unit
    - int
polatengin commented 3 years ago

Thanks for the contribution, @polatengin . This looks great. Just a few small points.

  • Can we we please add custom commands to the root README and also to docs (either a new doc file and/or user-guide.md?
  • Can we provide an example commands.yaml in the examples folder?
  • Can we add unit tests to ensure the new command code is covered by tests?

Thanks!

Hey @hattan, created a few new commits to resolve these issues. could you please review those changes?

Bests, Engin.