-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The idea is the following: support a hook/templating system that is independent from cookbooks but can be used to trigger automatic actions/created files in environments.
Here is a potentially typical workflow example:
- Cook a new worktree based environment for a git repo
- Use a set of
cpcommands to copy things like node_modules folders - Run setup scripts
- Open a set of windows with a fixes i3 layout
- Start dev server
For this, we could have a user-level folder to place different hooks. Hooks could be a folder that contain different things. The folder could look like this:
hook.yml
files/
templates/
scripts/
files/ would simply be files that are automatically created in the environment folder
templates/ would work similarly, but those files would first be rendered as string templates
scripts/ would be a set of scripts that would each be executed in parallel
The hook.yml file would contain some description that would be able to use some simple formula or scripting language in order to decide when the hook has to be applied. Such as in which events it has to be applied, and also potentially based on the environment name or the name of the cookbook the environment was created with.