Skip to content

add hooks/templates support #206

@kantord

Description

@kantord

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 cp commands 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions