Documentation ¶
Index ¶
- Constants
- func SetLogLevel(level logrus.Level)
- type Descendant
- type Error
- type Flow
- func (f *Flow) Execute(name string, variables map[string]string) error
- func (f *Flow) GetDefault() (*Step, error)
- func (f *Flow) GetStep(name string) (*Step, error)
- func (f *Flow) HasDefault() bool
- func (f *Flow) HasStep(name string) bool
- func (f Flow) String() string
- func (f *Flow) ValidateStep(name string) error
- type Step
Constants ¶
const ErrMissingFailureStep = Error("failure step not defined")
const ErrMissingStep = Error("step not defined")
const ErrMissingSuccessStep = Error("success step not defined")
const ErrNoScript = Error("no script in step")
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
SetLogLevel can be used to adjust the log level
Types ¶
type Descendant ¶
type Descendant struct { Name string `yaml:"name"` // Name is the referenced step Variables map[string]string `yaml:"variables"` // Variables is a list of variables that are set as environment variables }
Descendant represents on step after the current step that is it is a reference to a number of other steps
type Flow ¶
type Flow struct { // BreakOnError bool `yaml:"break_on_error"` // BreakOnError breaks if a script returns a non zero result Name string `yaml:"name"` // Name is a name for the flow Description string `yaml:"description"` // Description is a more descriptive text what the flow does Steps []Step `yaml:"steps"` // Steps is the collection of steps in the flow Shell string `yaml:"shell"` // Shell is the path or binary name for the shell to use to execute the script }
Flow represents a complete flow
func NewFromReader ¶
NewFromReader creates a Flow from a reader
func NewFromYAML ¶
NewFromYAML takes a yaml string and creates a Flow object
func (*Flow) Execute ¶
Execute takes a step name and starts to execute from there if no ma,e is given it tries to get the default namespace
func (*Flow) GetDefault ¶
GetDefault returns the default step
func (*Flow) HasDefault ¶
HasDefault returns true if there is a default step
A default step gets executed when no step is defined
func (*Flow) ValidateStep ¶
ValidateStep looks if a step could run successful
type Step ¶
type Step struct { Name string `yaml:"name"` // Name of a step, also used to reference from C(Descendant) Script []string `yaml:"script"` // Script to execute OnSuccess []Descendant `yaml:"on_success"` // OnSuccess is a list of steps to execute if the script returns with 0 OnFailure []Descendant `yaml:"on_failure"` // OnFailure is a list of steps to execute if the scripts returns not a 0 }
Step is a single execution point in a flow
func (*Step) HasFailure ¶
HasFailure returns true if there are further steps in case of a non successful run defined
func (*Step) HasSuccess ¶
HasSuccess returns true if there are further steps in case of a successful run defined
Source Files ¶
- flow_execute.go
- flow_from_reader.go
- flow_from_yaml.go
- flow_get_default.go
- flow_get_env_with_variables.go
- flow_get_step.go
- flow_has_default.go
- flow_has_step.go
- flow_string.go
- flow_validate_step.go
- step_apply_text_template.go
- step_execute.go
- step_execute_other.go
- step_has_failure.go
- step_has_success.go
- step_string.go
- types.go