Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Switch custom actions to being a single file #123

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Conversation

benc-uk
Copy link
Contributor

@benc-uk benc-uk commented Jun 23, 2021

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

@benc-uk benc-uk marked this pull request as ready for review June 23, 2021 11:20
Copy link
Contributor

@sebastus sebastus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

I wonder if it'll make life simpler if there's a "do not change below this line" section that defines the built in terraform actions. that way, all actions are the same and come from the same place.

@benc-uk benc-uk merged commit 5413d51 into main Jun 23, 2021
@benc-uk benc-uk deleted the refactor-cust-actions branch June 23, 2021 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants