procfile

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 6 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
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.

- 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 start more than one instance for a given process type. if the process type is declared with zero ("proc=0"), it is not started. Non declared process types are started once. Each process type has its own exclusive $PORT variable value.

- 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; "loop" 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.

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

Although internally runner.Runner supports waitbefore and multi-command processes, for simplicity of interface these features have been disabled in Procfile parser.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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