procfile

package
v2.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package procfile provides a parser that know how read an extended version of Procfile as described by Heroku (https://devcenter.heroku.com/articles/procfile).

This version allows to set specific behaviors per process type.

Example:

workdir: $GOPATH/src/github.com/example/go-app
basePort: 5000
observe: *.go *.js
ignore: /vendor
formation: web=2
build-server: make server
web: restart=fail waitfor=localhost:8888 ./server serve

Special process type names:

- 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.

- 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(r io.Reader) (*runner.Runner, error)

Parse takes a reader that contains an extended Procfile.

func ParseFormation

func ParseFormation(s string) map[string]int

ParseFormation interprets a string in the format "proc: quantity proc2: quantity"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL