mirror of
https://github.com/Platonic-Systems/process-compose-flake.git
synced 2024-10-05 18:08:10 +03:00
docs: {pre, post}Hook
under Usage
section (#64)
* docs: `{pre, post}Hook` under `Usage` section * sequence --------- Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
This commit is contained in:
parent
ee8cd505f0
commit
32c069e7ef
26
doc/index.md
26
doc/index.md
@ -74,6 +74,32 @@ devShells = {
|
||||
|
||||
You can enter your devShell by running `nix develop` and run `watch-server` to run your processes.
|
||||
|
||||
### preHook
|
||||
|
||||
If you'd like to run certain commands before starting the processes, you can add them to `preHook`:
|
||||
|
||||
```nix
|
||||
process-compose.watch-server = {
|
||||
preHook = ''
|
||||
# Cleanup on EXIT, this runs irrespective of exit-code of process-compose
|
||||
trap "rm -rf ./data" EXIT
|
||||
export USER=foo
|
||||
'';
|
||||
};
|
||||
```
|
||||
|
||||
### postHook
|
||||
|
||||
Or if you'd like to run certain commands upon successful execution of `process-compose`, i.e exits with `exit-code: 0`, then add them to `postHook`:
|
||||
|
||||
```nix
|
||||
process-compose.watch-server = {
|
||||
postHook = ''
|
||||
cat foo.txt
|
||||
'';
|
||||
};
|
||||
```
|
||||
|
||||
## Module API
|
||||
|
||||
Our submodule mirrors the [process-compose YAML schema](https://github.com/F1bonacc1/process-compose/blob/main/process-compose.yaml). A few things to remember:
|
||||
|
Loading…
Reference in New Issue
Block a user