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: restart=onbuild waitfor=localhost:8888 ./server serve alpha web-b: restart=onbuild 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.
- baseport: when set to a number, it will be used as the starting point for the $PORT environment variable. Each process type will have its own exclusive $PORT variable value.
- 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.
- formation: allows to control how many instances of a process type are started, format: procTypeA:# procTypeB:# ... procTypeN:#. If `procType` is absent, it is not started. Empty formations start one of each process.
- 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): "onbuild" will restart the process type at every build; "fail" will restart the process type on failure; "loop" restart the process when it naturally terminates; "temporary" runs the process only once.
- signal (in process types): "SIGTERM", "term", or "15" terminates the process; "SIGKILL", "kill", or "9" kills the process. The default is "SIGKILL".
- timeout (in process types): duration (in Go format) to wait after sending the signal to the process.
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. |