Documentation
¶
Overview ¶
Command runner is a very ugly and simple structured command executer that monitor file changes to trigger process restarts.
Create a file name Procfile in the root of the project you want to run, and add the following content:
workdir: $GOPATH/src/github.com/example/go-app observe: *.go *.js ignore: /vendor build-server: make server web-a: group=web restart=always waitfor=localhost:8888 ./server serve alpha web-b: group=web restart=always waitfor=localhost:8888 ./server serve bravo db: restart=failure waitfor=localhost:8888 ./server db
Special process types:
- workdir: the working directory. Environment variables are expanded. It follows the same rules for exec.Command.Dir.
- observe: a space separated list of file patterns to scan for. It uses filepath.Match internally. File patterns preceded with exclamation mark (!) will not trigger builds.
- ignore: a space separated list of ignored directories relative to workdir, typically vendor directories.
- build*: process type name prefixed by "build" are always executed first and in order of declaration. On failure, they halt the initialization.
- waitfor (in process type): target hostname and port that the runner will probe before starting the process type.
- restart (in process type): "always" will restart the process type at every build; "fail" will restart the process type on failure; "temporary" will start the service once and not restart it on rebuilds; "loop" will restart the process when it naturally terminates.
- group (in process type): group of processes that depend on each other. If a process type fails, it will halt all others in the same group. If the "restart" parameter is not set to "always" or "fail", the affected process types will halt and not restart.
- signal (in process types): "SIGTERM", "term", or "15" terminates the process; "SIGKILL", "kill", or "9" kills the process. The default is "SIGKILL".
- signalWait (in process types): duration to wait after sending the signal to the process.
- sticky (in build process types): a sticky build is not interrupted when file changes are detected.
- optional (in process types): does not start this process unless explicit told so. The process type must be part of a group.
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
procfile
Package procfile provides a parser that know how read an extended version of Procfile as described by Heroku (https://devcenter.heroku.com/articles/procfile).
|
Package procfile provides a parser that know how read an extended version of Procfile as described by Heroku (https://devcenter.heroku.com/articles/procfile). |
runner
Package runner holds the building blocks for cmd runner.
|
Package runner holds the building blocks for cmd runner. |