Documentation
¶
Index ¶
- func GetScriptCache(cacheDir, script string) (string, error)
- func RunTask(req *TaskExecRequest) (err error)
- type Action
- type BaseTask
- func (t *BaseTask) ContinueOnError() bool
- func (t *BaseTask) DoAfterFieldsResolved(ctx dukkha.RenderingContext, depth int, do func() error, fieldNames ...string) error
- func (t *BaseTask) GetHookExecSpecs(taskCtx dukkha.TaskExecContext, stage dukkha.TaskExecStage) ([]dukkha.RunTaskOrRunCmd, error)
- func (t *BaseTask) GetMatrixSpecs(rc dukkha.RenderingContext) ([]matrix.Entry, error)
- func (t *BaseTask) InitBaseTask(k dukkha.ToolKind, n dukkha.ToolName, tk dukkha.TaskKind, impl dukkha.Task)
- func (t *BaseTask) Key() dukkha.TaskKey
- func (t *BaseTask) Kind() dukkha.TaskKind
- func (t *BaseTask) Name() dukkha.TaskName
- func (t *BaseTask) ToolKind() dukkha.ToolKind
- func (t *BaseTask) ToolName() dukkha.ToolName
- type BaseTool
- func (t *BaseTool) DoAfterFieldsResolved(ctx dukkha.TaskExecContext, depth int, do func() error, fieldNames ...string) 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(kind dukkha.ToolKind, defaultExecutable, cacheDir string, impl dukkha.Tool) error
- func (t *BaseTool) Key() dukkha.ToolKey
- func (t *BaseTool) Kind() dukkha.ToolKind
- func (t *BaseTool) Name() dukkha.ToolName
- func (t *BaseTool) ResolveTasks(tasks []dukkha.Task) error
- func (t *BaseTool) Run(taskCtx dukkha.TaskExecContext) error
- func (t *BaseTool) ShellName() string
- func (t *BaseTool) UseShell() bool
- type BaseToolWithInit
- type TaskExecRequest
- type TaskHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetScriptCache ¶
Types ¶
type Action ¶
type Action struct {
rs.BaseField
// Name of this action, optional
Name string `yaml:"name"`
// Env specific to this action
Env dukkha.Env `yaml:"env"`
// Task reference of this action
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
Task string `yaml:"task"`
// EmbeddedShell using embedded shell
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
EmbeddedShell string `yaml:"shell"`
// EmbeddedShell script for this action
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
ExternalShell map[string]string `rs:"other"`
// Cmd execution, not in any shell
//
// Task, Cmd, EmbeddedShell, ExternalShell are mutually exclusive
Cmd []string `yaml:"cmd"`
// 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"`
// contains filtered or unexported fields
}
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
TaskName string `yaml:"name"`
Env dukkha.Env `yaml:"env"`
Matrix matrix.Spec `yaml:"matrix"`
Hooks TaskHooks `yaml:"hooks"`
ContinueOnErrorFlag bool `yaml:"continue_on_error"`
// 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.RunTaskOrRunCmd, error)
func (*BaseTask) GetMatrixSpecs ¶
func (*BaseTask) InitBaseTask ¶
type BaseTool ¶
type BaseTool struct {
rs.BaseField
ToolName string `yaml:"name"`
Env dukkha.Env `yaml:"env"`
Cmd []string `yaml:"cmd"`
// Whether to run this tool in shell and which shell to use
UsingShell bool `yaml:"use_shell"`
UsingShellName string `yaml:"shell_name"`
// contains filtered or unexported fields
}
func (*BaseTool) DoAfterFieldsResolved ¶
func (*BaseTool) InitBaseTool ¶
func (t *BaseTool) InitBaseTool( kind dukkha.ToolKind, defaultExecutable, cacheDir string, impl dukkha.Tool, ) error
InitBaseTool must be called in your own version of Init() with correct defaultExecutable name
MUST be called when in Init
func (*BaseTool) ResolveTasks ¶
ResolveTasks accepts all tasks, override this function if your tool need different handling of tasks
type BaseToolWithInit ¶
func (*BaseToolWithInit) GetExecSpec ¶
func (t *BaseToolWithInit) GetExecSpec( toExec []string, isFilePath bool, ) (env dukkha.Env, cmd []string, err error)
GetExecSpec is a helper func for shells
type TaskExecRequest ¶
type TaskHooks ¶
type TaskHooks struct {
rs.BaseField
// 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 []Action `yaml:"before"`
// Before a specific matrix execution start
//
// This hook May have reference to matrix information
BeforeMatrix []Action `yaml:"before:matrix"`
// AfterMatrixSuccess runs after a successful matrix execution
//
// This hook May have reference to matrix information
AfterMatrixSuccess []Action `yaml:"after:matrix:success"`
// AfterMatrixFailure runs after a failed matrix execution
//
// This hook May have reference to matrix information
AfterMatrixFailure []Action `yaml:"after:matrix:failure"`
// AfterMatrix runs after at any condition of the matrix execution
// including success, failure
//
// This hook May have reference to matrix information
AfterMatrix []Action `yaml:"after:matrix"`
// AfterSuccess runs after a successful task execution
// requires all matrix executions are successful
//
// This hook MUST NOT have any reference to matrix information
AfterSuccess []Action `yaml:"after:success"`
// 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 []Action `yaml:"after:failure"`
// 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 []Action `yaml:"after"`
}
func (*TaskHooks) GenSpecs ¶
func (h *TaskHooks) GenSpecs( taskCtx dukkha.TaskExecContext, stage dukkha.TaskExecStage, ) ([]dukkha.RunTaskOrRunCmd, error)
func (*TaskHooks) GetFieldNameByStage ¶
func (*TaskHooks) GetFieldNameByStage(stage dukkha.TaskExecStage) string
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.