Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRunner = "sh"
DefaultRunner defines the runner to use in case the task does not specify it.
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 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 Dogtasks ¶ added in v0.5.0
type Dogtasks 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 Dogtasks object. Files []string }
Dogtasks is a collection of tasks with optional metadata from the runtime.
func Parse ¶ added in v0.5.0
Parse accepts a slice of bytes and parses it following the Dogfile Spec.
func ParseFromDisk ¶ added in v0.5.0
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 // Register stores the output of the task so it can be accessed by // other tasks in the task chain. // // When present, a new environment variable is injected in future // task chain runners using the register name as key and the output // as value. Register string }
Task represents a task described in the Dogfile format.
type TaskChain ¶
type TaskChain struct {
Tasks []Task
}
TaskChain contains one or more tasks to be executed in order.
func NewTaskChain ¶ added in v0.5.0
NewTaskChain creates the task chain for a specific dogfile and task.