Documentation ¶
Index ¶
- Constants
- Variables
- func BlockFlowRun(flow *Steps, execVars *core.Cache)
- func BlockStack() *stack.ExecStack
- func ConfigRuntime() *utils.UpConfig
- func DecryptAndRegister(securetag *u.SecureSetting, dvar *Dvar, contextVars *core.Cache, ...)
- func DryRunAndSkip(mark string, allowedErrors []string, continueFunc ContinueFunc, ...)
- func DryRunOrExit(mark string, mustCondition MustConditionToContinueFunc, conditionDesc string)
- func ExecTask(fulltaskname string, callerVars *core.Cache)
- func FuncMapInit()
- func GetBaseModuleName() string
- func GlobalVarsMergedWithDvars(scope *Scope) (vars *core.Cache)
- func InitDefaultSkeleton()
- func IsAtRootTaskLevel() (called bool)
- func IsCalledTask() (called bool)
- func ListAllFuncs()
- func ListAllModules()
- func Render(tstr string, obj interface{}) string
- func ScopeVarsMergedWithDvars(scope *Scope, contextMergedVars *core.Cache) *core.Cache
- func SetBaseDir(dir string)
- func SetDryrun()
- func StepStack() *stack.ExecStack
- func ToJson(str string) string
- func VarsMergedWithDvars(mark string, baseVars *core.Cache, dvars *Dvars, contextMergedVars *core.Cache) *core.Cache
- type BlockFuncAction
- type BlockRuntimeContext
- type CallFuncAction
- type CmdCmd
- type CmdCmds
- type CmdFuncAction
- type ContextInstances
- type ContinueFunc
- type Dvar
- type Dvars
- type GeneralCmd
- type LoopItem
- type MustConditionToContinueFunc
- type Scope
- type ScopeContext
- type Scopes
- type ShellFuncAction
- type Step
- type StepRuntimeContext
- type Steps
- type TaskRuntimeContext
- type Tasker
- func (t *Tasker) CleanModules()
- func (t *Tasker) ExecTask(taskname string, callerVars *core.Cache, isExternalCall bool)
- func (t *Tasker) InitContextInstances(ss *Scopes)
- func (tasker *Tasker) InspectTask(taskname string, branch treeprint.Tree, level *int) bool
- func (t *Tasker) ListAllTasks()
- func (t *Tasker) ListMainModules()
- func (tasker *Tasker) ListTask(taskname string)
- func (t *Tasker) ListTasks()
- func (t *Tasker) LockModules()
- func (t *Tasker) PullModules()
- func (t *Tasker) SetRuntimeGlobalMergedWithDvars()
- func (t *Tasker) SetRuntimeVarsMerged(runtimeid string)
- func (t *Tasker) Unset()
- func (t *Tasker) ValidateAllModules() bool
- func (t *Tasker) ValidateTask(taskname string)
- type TaskerRuntimeContext
Constants ¶
const ( UP_RUNTIME_TASK_LAYER_NUMBER = "up_runtime_task_layer_number" UP_RUNTIME_TASKER_LAYER_NUMBER = "up_runtime_tasker_layer_number" )
const ( FUNC_SHELL = "shell" FUNC_CALL = "call" FUNC_BLOCK = "block" FUNC_CMD = "cmd" )
Variables ¶
Functions ¶
func BlockFlowRun ¶
func BlockStack ¶
func ConfigRuntime ¶
func DecryptAndRegister ¶
func DryRunAndSkip ¶
func DryRunAndSkip(mark string, allowedErrors []string, continueFunc ContinueFunc, mustCondition MustConditionToContinueFunc)
if there is NoFault, then continue or if there is a fault in the allowed list, then skip rest, do not run continueFunc else the fault is not ignorable, then if use DryRunOrExitFunc
func DryRunOrExit ¶
func DryRunOrExit(mark string, mustCondition MustConditionToContinueFunc, conditionDesc string)
func FuncMapInit ¶
func FuncMapInit()
func GetBaseModuleName ¶
func GetBaseModuleName() string
func InitDefaultSkeleton ¶
func InitDefaultSkeleton()
func IsAtRootTaskLevel ¶
func IsAtRootTaskLevel() (called bool)
func IsCalledTask ¶
func IsCalledTask() (called bool)
func ListAllFuncs ¶
func ListAllFuncs()
func ListAllModules ¶
func ListAllModules()
probing modules list all modules, including the main direct modules and the all indirect modules
func SetBaseDir ¶
func SetBaseDir(dir string)
Types ¶
type BlockFuncAction ¶
func (*BlockFuncAction) Adapt ¶
func (f *BlockFuncAction) Adapt()
func (*BlockFuncAction) Exec ¶
func (f *BlockFuncAction) Exec()
type BlockRuntimeContext ¶
type CallFuncAction ¶
func (*CallFuncAction) Adapt ¶
func (f *CallFuncAction) Adapt()
adapt the abstract step.Do to concrete ShellFuncAction Cmds
func (*CallFuncAction) Exec ¶
func (f *CallFuncAction) Exec()
type CmdFuncAction ¶
func (*CmdFuncAction) Adapt ¶
func (f *CmdFuncAction) Adapt()
func (*CmdFuncAction) Exec ¶
func (f *CmdFuncAction) Exec()
type ContextInstances ¶
type ContextInstances []ScopeContext
type ContinueFunc ¶
type ContinueFunc func()
type Dvars ¶
type Dvars []Dvar
func (*Dvars) ValidateAndLoading ¶
type GeneralCmd ¶
type MustConditionToContinueFunc ¶
type MustConditionToContinueFunc func() bool
type ScopeContext ¶
type ShellFuncAction ¶
type ShellFuncAction struct { Do interface{} Vars *core.Cache Cmds []string Result u.ExecResult }
func (*ShellFuncAction) Adapt ¶
func (f *ShellFuncAction) Adapt()
adapt the abstract step.Do to concrete ShellFuncAction Cmds
func (*ShellFuncAction) Exec ¶
func (f *ShellFuncAction) Exec()
type Step ¶
type StepRuntimeContext ¶
type StepRuntimeContext struct { Stepname string Result *u.ExecResult }
func StepRuntime ¶
func StepRuntime() *StepRuntimeContext
type TaskRuntimeContext ¶
type TaskRuntimeContext struct { Taskname string TasknameLayered string ExecbaseVars *core.Cache TaskVars *core.Cache ReturnVars *core.Cache IsCalledExternally bool }
func TaskRuntime ¶
func TaskRuntime() *TaskRuntimeContext
type Tasker ¶
type Tasker struct { TaskYmlRoot *viper.Viper Tasks *model.Tasks InstanceName string Dryrun bool TaskStack *stack.ExecStack StepStack *stack.ExecStack BlockStack *stack.ExecStack TaskBreak bool Config *u.UpConfig GroupMembersList []string MemberGroupMap map[string]string //expanded context only contains group and global scope, but not each instance vars ExpandedContext ScopeContext ScopeProfiles *Scopes //this is the merged vars from within scope: global, groups level (if there is), instance varss, then global runtime vars RuntimeVarsMerged *core.Cache //this is the merged vars and dvars to a vars cache from within scope: global, groups level (if there is), instance varss, then global runtime vars //this vars should be used instead of RuntimeVarsMerged as it include both runtime vars and dvars except the local vars and dvars RuntimeVarsAndDvarsMerged *core.Cache RuntimeGlobalVars *core.Cache RuntimeGlobalDvars *Dvars }
func (*Tasker) CleanModules ¶
func (t *Tasker) CleanModules()
func (*Tasker) InitContextInstances ¶
func (*Tasker) InspectTask ¶
func (*Tasker) ListAllTasks ¶
func (t *Tasker) ListAllTasks()
func (*Tasker) LockModules ¶
func (t *Tasker) LockModules()
func (*Tasker) PullModules ¶
func (t *Tasker) PullModules()
func (*Tasker) SetRuntimeGlobalMergedWithDvars ¶
func (t *Tasker) SetRuntimeGlobalMergedWithDvars()
func (*Tasker) SetRuntimeVarsMerged ¶
This will generate a one off vars merged from top level down to runtime global and merge them all together,the result vars will be used to finally merge with local func vars to be used in runtime execution time
pass in runtime id, if runtime id is in member list, eg dev -> nonprod then merge runtimevars to group(nonprod)'s varss,
if runtime id (nonname) is not in member list, then merge runtimevars to global varss,
This has chained dvar expansion through global to group then to instance level and finally merge with global var, except the global dvars
func (*Tasker) ValidateAllModules ¶
func (*Tasker) ValidateTask ¶
type TaskerRuntimeContext ¶
func TaskerRuntime ¶
func TaskerRuntime() *TaskerRuntimeContext