Documentation
¶
Index ¶
- Variables
- func ApplyDropIns(t *Task, dropins []*conf.DropIn, spec map[string]map[string]conf.OptionSpec) error
- func ApplyEnvironment(tsk *Task) error
- func EvaluateConditions(t *Task) (*condition.Instance, error)
- func LoadEnv(t *Task) error
- func RegisterAllConditions()
- func RegisterCondition(cond condition.Condition)
- func TaskOptions() []conf.OptionSpec
- type Task
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidTaskSection = errors.New("invalid task section")
ErrInvalidTaskSection is returned if a section is invalid.
Functions ¶
func ApplyDropIns ¶
func ApplyDropIns(t *Task, dropins []*conf.DropIn, spec map[string]map[string]conf.OptionSpec) error
ApplyDropIns applies all dropins on t. It basically wraps conf.ApplyDropIns and re-creates the tasks meta-data.
func ApplyEnvironment ¶
ApplyEnvironment applies environment variable substitution to all unit options. If tsk.Environment is nil, ApplyEnvironment tries to call LoadEnv(tsk) first. Note that ApplyEnvironment does not substitude variables in the tasks meta section.
func EvaluateConditions ¶
EvaluateConditions evalutes all conditions of a task. If any condition fails the condition is returned along with an error. If all conditions are met, EvalutateConditions returns nil, nil.
func LoadEnv ¶
LoadEnv loads all environment files specified in t.EnvironmentFiles and populates t.Environment.
func RegisterAllConditions ¶
func RegisterAllConditions()
RegisterAllConditions registers all built-in conditions from the condition package.
func RegisterCondition ¶
RegisterCondition registers a new condition type for the task meta-section.
func TaskOptions ¶
func TaskOptions() []conf.OptionSpec
TaskOptions returns a slice of OptionSpec that are allowed int he task meta section.
Types ¶
type Task ¶
type Task struct {
// FileName is the name of the file that describes this task.
FileName string
// Directory holds the directory of the task.
Directory string
// Description is the tasks description.
Description string
// StartMasked is set to true if this task is disabled (masked)
// by default.
StartMasked bool
// Disabled can be set to true to disable a task permanently.
Disabled bool
// EnvironmentFiles holds a list of environment files.
EnvironmentFiles []string
// Sections holds the tasks sections.
Sections []conf.Section
// Environment holds the parsed environment.
Environment []string
// Conditions is a list of conditions that must match.
Conditions []condition.Instance
// contains filtered or unexported fields
}
Task defines a deploy task.
func DecodeFile ¶
DecodeFile is like Decode but reads the task from filePath.