1build
1build copied to clipboard
`before` and `after` life cycle hooks per each command
Description
Currently, we have before
and after
life cycle hooks that get executed before and after all the specified commands are executed. However, In some scenarios, it might be the case that we also need more granular life cycle hooks within the scope of a single command.
project: Sample Web App
before: export VARNAME="my value"
after: unset VARNAME
commands:
- build:
before: echo "before"
command: npm run build
after: echo "after"
Acceptance Criteria
- User should be able to define
before
andafter
for each individual command - Should be able to disable global
before
andafter
for an individual command
@akhilbojedla Good feature to have.
Current before
after runs as before all
and after all
is you run multiple commands at a time.
Having per command would definitely help.
It will change the contract for the file. Need to think if we can accommodate it with existing structure.
@gopinath-langote I think it should be possible. If we can update our config yml parsing logic. We can make it to either accept a string (which would then be executed as command) or nested properties with lifecycle definitions.