Documentation
¶
Index ¶
- func CreateTaskMatrixContext(req *TaskExecRequest, ms matrix.Entry, opts dukkha.TaskExecOptions) (dukkha.TaskExecContext, dukkha.TaskMatrixExecOptions, error)
- func GetScriptCache(cacheFS *fshelper.OSFS, script string) (string, error)
- func ResolveActions(rc dukkha.TaskExecContext, x dukkha.Resolvable, actionsFieldName string, ...) ([]dukkha.TaskExecSpec, error)
- func RunTask(req *TaskExecRequest) (err error)
- type Action
- type Actions
- type BaseTask
- func (t *BaseTask) ContinueOnError() bool
- func (t *BaseTask) DoAfterFieldsResolved(ctx dukkha.RenderingContext, depth int, resolveEnv bool, do func() error, ...) error
- func (t *BaseTask) GetHookExecSpecs(taskCtx dukkha.TaskExecContext, stage dukkha.TaskExecStage) ([]dukkha.TaskExecSpec, error)
- func (t *BaseTask) GetMatrixSpecs(rc dukkha.RenderingContext) (ret []matrix.Entry, err error)
- func (t *BaseTask) Init(cacheFS *fshelper.OSFS) error
- func (t *BaseTask) InitBaseTask(k dukkha.ToolKind, n dukkha.ToolName, impl dukkha.Task)
- func (t *BaseTask) ToolKind() dukkha.ToolKind
- func (t *BaseTask) ToolName() dukkha.ToolName
- type BaseTool
- func (t *BaseTool) AddTasks(tasks []dukkha.Task) error
- func (t *BaseTool) AllTasks() map[dukkha.TaskKey]dukkha.Task
- func (t *BaseTool) DoAfterFieldsResolved(ctx dukkha.RenderingContext, depth int, resolveEnv bool, do func() error, ...) error
- func (t *BaseTool) GetCmd() []string
- func (t *BaseTool) GetEnv() dukkha.Env
- func (t *BaseTool) GetTask(k dukkha.TaskKey) (dukkha.Task, bool)
- func (t *BaseTool) InitBaseTool(defaultExecutable string, cacheFS *fshelper.OSFS, impl dukkha.Tool) error
- func (t *BaseTool) Run(ctx dukkha.TaskExecContext, key dukkha.TaskKey) error
- type ShellTool
- type TaskExecRequest
- type TaskHooks
- type TaskReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTaskMatrixContext ¶ added in v0.4.0
func CreateTaskMatrixContext( req *TaskExecRequest, ms matrix.Entry, opts dukkha.TaskExecOptions, ) (dukkha.TaskExecContext, dukkha.TaskMatrixExecOptions, error)
CreateTaskMatrixContext creates a per matrix entry task exec options with context resolved
func ResolveActions ¶ added in v0.5.0
func ResolveActions( rc dukkha.TaskExecContext, x dukkha.Resolvable, actionsFieldName string, actionsTagName string, ) ([]dukkha.TaskExecSpec, error)
Types ¶
type Action ¶
type Action struct {
rs.BaseField `yaml:"-"`
// Name of this action
//
// if set, can be used as value for `Next`
//
// Defaults to `#i` where i is the index of this action in slice (starting from 0)
//
// this field MUST NOT use any kind of rendering suffix, or will be set
// to default
Name string `yaml:"name"`
// Env specific to this action
Env dukkha.Env `yaml:"env"`
// Run checks running condition, only run this action when set to true
//
// Defaults to `true`
Run *bool `yaml:"if"`
// Idle does nothing but serves as a placeholder for preparation purpose
// recommended usage of Idle action is to apply renderers like `tlang`
// to do some task execution state related operation (e.g. set global
// value with `dukkha.SetValue`)
Idle interface{} `yaml:"idle,omitempty"`
// Task reference of this action
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
Task *TaskReference `yaml:"task,omitempty"`
// EmbeddedShell using embedded shell
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
EmbeddedShell string `yaml:"shell,omitempty"`
// ExternalShell script for this action
//
// Task, Cmd, ExternalShell, ExternalShell are mutually exclusive
ExternalShell map[string]string `yaml:",inline,omitempty"`
// Cmd execution, not in any shell
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
Cmd []string `yaml:"cmd,omitempty"`
// Chdir change working directory before executing command
// this option only applies to Cmd, EmbeddedShell, ExternalShell action
Chdir string `yaml:"chdir"`
// ContuineOnError ignores error occurred in this action and continue
// following actions in list (if any)
ContinueOnError bool `yaml:"continue_on_error"`
// Next action name
// NOTE: this field is resolved after execution finished (right before leaving this action)
//
// Defaults to the next action in the same list
Next *string `yaml:"next"`
// contains filtered or unexported fields
}
Action is a collection of all kinds of work can be done in a single step but only one kind of work is allowed in a single step
func (*Action) DoAfterFieldResolved ¶
func (*Action) GenSpecs ¶
func (act *Action) GenSpecs( ctx dukkha.TaskExecContext, index int, ) (dukkha.RunTaskOrRunCmd, error)
type BaseTask ¶
type BaseTask struct {
rs.BaseField `yaml:"-"`
Env dukkha.Env `yaml:"env"`
Matrix matrix.Spec `yaml:"matrix"`
Hooks TaskHooks `yaml:"hooks,omitempty"`
ContinueOnErrorFlag bool `yaml:"continue_on_error"`
CacheFS *fshelper.OSFS `yaml:"-"`
// contains filtered or unexported fields
}
func (*BaseTask) ContinueOnError ¶
func (*BaseTask) DoAfterFieldsResolved ¶
func (*BaseTask) GetHookExecSpecs ¶
func (t *BaseTask) GetHookExecSpecs( taskCtx dukkha.TaskExecContext, stage dukkha.TaskExecStage, ) ([]dukkha.TaskExecSpec, error)
func (*BaseTask) GetMatrixSpecs ¶
func (*BaseTask) InitBaseTask ¶
type BaseTool ¶
type BaseTool struct {
rs.BaseField `yaml:"-"`
Env dukkha.Env `yaml:"env"`
Cmd []string `yaml:"cmd"`
CacheFS *fshelper.OSFS `yaml:"-"`
// contains filtered or unexported fields
}
func (*BaseTool) AddTasks ¶ added in v0.5.1
AddTasks accepts all tasks, override this function if your tool need different handling of tasks
func (*BaseTool) DoAfterFieldsResolved ¶
type ShellTool ¶ added in v0.7.0
type ShellTool struct {
rs.BaseField `yaml:"-"`
ToolName dukkha.ToolName `yaml:"name"`
BaseTool `yaml:",inline"`
}
type TaskExecRequest ¶
type TaskHooks ¶
type TaskHooks struct {
rs.BaseField `yaml:"-"`
// Before runs before the task execution start
// if this hook failed, the whole task execution is canceled
// and will run `After` hooks
//
// This hook MUST NOT have any reference to matrix information
Before Actions `yaml:"before,omitempty"`
// Before a specific matrix execution start
//
// This hook May have reference to matrix information
BeforeMatrix Actions `yaml:"before:matrix,omitempty"`
// AfterMatrixSuccess runs after a successful matrix execution
//
// This hook May have reference to matrix information
AfterMatrixSuccess Actions `yaml:"after:matrix:success,omitempty"`
// AfterMatrixFailure runs after a failed matrix execution
//
// This hook May have reference to matrix information
AfterMatrixFailure Actions `yaml:"after:matrix:failure,omitempty"`
// AfterMatrix runs after at any condition of the matrix execution
// including success, failure
//
// This hook May have reference to matrix information
AfterMatrix Actions `yaml:"after:matrix,omitempty"`
// AfterSuccess runs after a successful task execution
// requires all matrix executions are successful
//
// This hook MUST NOT have any reference to matrix information
AfterSuccess Actions `yaml:"after:success,omitempty"`
// AfterFailure runs after a failed task execution
// any failed matrix execution will cause this hook to run
//
// This hook MUST NOT have any reference to matrix information
AfterFailure Actions `yaml:"after:failure,omitempty"`
// After any condition of the task execution
// including success, failure, canceled (hook `before` failure)
//
// This hook MUST NOT have any reference to matrix information
After Actions `yaml:"after,omitempty"`
}
func (*TaskHooks) DoAfterFieldsResolved ¶ added in v0.5.0
func (*TaskHooks) GenSpecs ¶
func (h *TaskHooks) GenSpecs( taskCtx dukkha.TaskExecContext, stage dukkha.TaskExecStage, ) ([]dukkha.TaskExecSpec, error)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package golang provides golang toolchain (go) support for dukkha
|
Package golang provides golang toolchain (go) support for dukkha |
|
Package helm provides helm v3 task support
|
Package helm provides helm v3 task support |
Click to show internal directories.
Click to hide internal directories.