Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRunner string
DefaultRunner defines the runner to use in case the task does not specify it.
The value is automatically assigned based on the operating system when the package initializes.
var ErrCycleInTaskChain = errors.New("TaskChain includes a cycle of tasks")
ErrCycleInTaskChain means that there is a loop in the path of tasks execution.
var ErrMalformedStringArray = errors.New("Malformed strings array")
ErrMalformedStringArray means that a task have a value of pre, post or env that can't be parsed as an array of strings.
var ErrNoDogfile = errors.New("No dogfile found")
ErrNoDogfile means that the application is unable to find a Dogfile in the specified directory.
var ProvideExtraInfo bool
ProvideExtraInfo specifies if dog needs to provide execution info (duration, exit status) after task execution.
Functions ¶
func DeprecationWarnings ¶
DeprecationWarnings writes deprecation warnings if they have been found on parse time.
Call it with os.Stderr as a parameter to print warnings to STDERR.
func FindDogfiles ¶
FindDogfiles finds Dogfiles in disk for a given path.
It traverses directories until it finds one containing Dogfiles. If such a directory is found, the function returns the full path for each valid Dogfile in that directory.
Types ¶
type Dogfile ¶
type Dogfile struct {
// Tasks is used to map task objects by their name.
Tasks map[string]*Task
// Path is an optional field that stores the directory
// where the Dogfile is found.
Path string
// Files is an optional field that stores the full path
// of each Dogfile used to define the Dogfile object.
Files []string
}
Dogfile contains tasks defined in the Dogfile format.
func (*Dogfile) ParseFromDisk ¶
ParseFromDisk finds a Dogfile in disk and parses it.
type Task ¶
type Task struct {
// Name of the task.
Name string
// Description of the task.
Description string
// The code that will be executed.
Code string
// Defaults to operating system main shell.
Runner string
// Pre-hooks execute other tasks before starting the current one.
Pre []string
// Post-hooks are analog to pre-hooks but they are executed after
// current task finishes its execution.
Post []string
// Default values for environment variables can be provided in the Dogfile.
// They can be modified at execution time.
Env []string
// Sets the working directory for the task. Relative paths are
// considered relative to the location of the Dogfile.
Workdir string
}
Task represents a task described in the Dogfile format.