Configuration
Mimamoru's config file by default is $PWD/mimamoru.yaml.
Use --config param or MIMAMORU_CONFIG env var to specify a custom file.
Schema
global
Global configuration/parameters which sets defaults for watches.
inactivity_timeout: 300ms
restart_backoff: 1s
restart: false
inactivity_timeout: Time to wait until no more events are received. This helps debounce frequent time modifications/events, like when your editor formats the file after saving it. Mimamoru waits for the specified time after an event, if no subsequent event occurs it runs the prep commands and restarts the daemons afterwards.restart_backoff: How long to wait before restarting daemons after exit.restart: Whether to restart daemons which exited. Set this tofalseif your "daemon" process only runs tests for example.
watches
<name>:
paths:
- "**/*.go"
- "go.mod"
ignore:
- "**/vendor/**"
- "**/*_test.go"
prep: []
daemons: {}
# Override global settings
inactivity_timeout: 500ms
restart_backoff: 2s
paths
File paths/patters to watch for changes.
ignore
File paths/patterns to ignore when watching for changes.
Note
This has precendence over paths, so if you specify a/*.go in paths
and a/test.go in ignore, a/test.go will be ignored while changes to a/example.go
trigger the watch.
prep
Prep commands run sequentially and must succeed for the daemons to get restarted.
name: "build"
command: "go build ./cmd/app -o bin/app"
daemons
Daemons run concurrently and get auto restarted (except when restart=false).
Once all prep commands for a watch succeed, all daemons are restarted (running ones are
terminated with SIGTERM, finished ones simply get started again).
<name>:
command: "./bin/app"
env: {}
stop_signal: SIGTERM
stop_timeout: 10s
restart: false
command: Command to run.env: Map/dictionary of environment variables for this daemon.stop_signal: Which signal is sent to restart/stop the daemon.stop_timeout: Timeout, when the daemon is still running after this time it getsSIGKILLed.restart: Whether to restart the daemon when it exits on its own. Set this tofalseif your "daemon" process only runs tests for example.