Documentation
¶
Index ¶
- Variables
- func GenerateJSONSchema() ([]byte, error)
- func ParseDuration(s string) (time.Duration, error)
- func SaveSchemaToFile(filename string) error
- func Validate(config *SetupConfig) error
- type APIClientInterface
- type ActionFactory
- type AptInstall
- type AssertHTTP
- type BrewInstall
- type ChocoInstall
- type CommandExecutor
- type CommandRequest
- type ConditionEvaluator
- type Context
- type Defaults
- type EnsureDatabase
- type EnsurePackageManager
- type EnsureRuntime
- type EnsureTool
- type Environment
- type ExecutableCommand
- type ExecutionPlan
- type ExecutionSummary
- type Executor
- type Matrix
- type MatrixMatcher
- type ParsedDuration
- type ParsedRetries
- type Phase
- type PhaseSummary
- type RenderContext
- type Retries
- type RetryPolicy
- type RuntimeFallbackInstaller
- type RuntimeManager
- type SetupConfig
- type SetupRunner
- type Step
- type StorageInterface
- type ToolInstallConfig
- type ValidationError
- type ValidationErrors
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoCommandsToExecute = errors.New("no commands to execute")
Functions ¶
func GenerateJSONSchema ¶
func SaveSchemaToFile ¶
func Validate ¶
func Validate(config *SetupConfig) error
Types ¶
type APIClientInterface ¶
type ActionFactory ¶
type ActionFactory struct{}
func NewActionFactory ¶
func NewActionFactory() *ActionFactory
func (*ActionFactory) BuildFromStep ¶
func (f *ActionFactory) BuildFromStep(step *Step) (actions.Action, error)
type AptInstall ¶
type AssertHTTP ¶
type BrewInstall ¶
type BrewInstall struct {
Formula string `yaml:"formula" json:"formula"`
}
type ChocoInstall ¶
type ChocoInstall struct {
Packages []string `yaml:"packages" json:"packages"`
}
type CommandExecutor ¶
type CommandExecutor interface {
Execute(ctx context.Context, req *CommandRequest) error
}
func NewRealCommandExecutor ¶
func NewRealCommandExecutor() CommandExecutor
type CommandRequest ¶
type ConditionEvaluator ¶
func NewConditionEvaluator ¶
func NewConditionEvaluator(os, arch string, env map[string]string) *ConditionEvaluator
func (*ConditionEvaluator) Evaluate ¶
func (e *ConditionEvaluator) Evaluate(condition string) (bool, error)
func (*ConditionEvaluator) ShouldExecuteStep ¶
func (e *ConditionEvaluator) ShouldExecuteStep(step *Step) (bool, error)
type Context ¶
func NewContext ¶
type Defaults ¶
type Defaults struct {
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
Shell string `yaml:"shell,omitempty" json:"shell,omitempty"`
ContinueOnError bool `yaml:"continue_on_error,omitempty" json:"continue_on_error,omitempty"`
CWD string `yaml:"cwd,omitempty" json:"cwd,omitempty"`
}
type EnsureDatabase ¶
type EnsureDatabase struct {
Engine string `yaml:"engine" json:"engine"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
ServiceName string `yaml:"service_name,omitempty" json:"service_name,omitempty"`
EnsureRunning bool `yaml:"ensure_running,omitempty" json:"ensure_running,omitempty"`
CreateDB []string `yaml:"create_db,omitempty" json:"create_db,omitempty"`
}
type EnsurePackageManager ¶
type EnsurePackageManager struct {
Type string `yaml:"type" json:"type"`
}
type EnsureRuntime ¶
type EnsureRuntime struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Manager *RuntimeManager `yaml:"manager,omitempty" json:"manager,omitempty"`
FallbackInstallers []RuntimeFallbackInstaller `yaml:"fallback_installers,omitempty"`
}
type EnsureTool ¶
type EnsureTool struct {
Name string `yaml:"name" json:"name"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Install *ToolInstallConfig `yaml:"install,omitempty" json:"install,omitempty"`
}
type Environment ¶
type ExecutableCommand ¶
type ExecutionPlan ¶
type ExecutionPlan struct {
Commands []ExecutableCommand
Summary ExecutionSummary
}
func Render ¶
func Render(config *SetupConfig, ctx *RenderContext) (*ExecutionPlan, error)
type ExecutionSummary ¶
type ExecutionSummary struct {
TotalSteps int
TotalCommands int
Phases []PhaseSummary
}
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutorWithCommandExecutor ¶
func NewExecutorWithCommandExecutor(secrets map[string]string, executor CommandExecutor) *Executor
func (*Executor) Execute ¶
func (e *Executor) Execute(plan *ExecutionPlan) error
type MatrixMatcher ¶
func NewMatrixMatcher ¶
func NewMatrixMatcher() *MatrixMatcher
func (*MatrixMatcher) GetCurrentPlatform ¶
func (m *MatrixMatcher) GetCurrentPlatform() string
func (*MatrixMatcher) GetSupportedPlatforms ¶
func (m *MatrixMatcher) GetSupportedPlatforms(config *SetupConfig) []string
func (*MatrixMatcher) IsCurrentPlatformSupported ¶
func (m *MatrixMatcher) IsCurrentPlatformSupported(config *SetupConfig) (bool, error)
func (*MatrixMatcher) Matches ¶
func (m *MatrixMatcher) Matches(config *SetupConfig) (bool, error)
type ParsedDuration ¶
type ParsedRetries ¶
type Phase ¶
func GetAllPhases ¶
func GetAllPhases(config *SetupConfig) []Phase
type PhaseSummary ¶
type RenderContext ¶
type RetryPolicy ¶
func ParseRetryPolicy ¶
func ParseRetryPolicy(retries *Retries) *RetryPolicy
type RuntimeFallbackInstaller ¶
type RuntimeFallbackInstaller struct {
Brew *BrewInstall `yaml:"brew,omitempty" json:"brew,omitempty"`
Apt *AptInstall `yaml:"apt,omitempty" json:"apt,omitempty"`
Choco *ChocoInstall `yaml:"choco,omitempty" json:"choco,omitempty"`
}
type RuntimeManager ¶
type RuntimeManager struct {
Asdf bool `yaml:"asdf,omitempty" json:"asdf,omitempty"`
}
type SetupConfig ¶
type SetupConfig struct {
Version int `yaml:"version" json:"version"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Matrix *Matrix `yaml:"matrix,omitempty" json:"matrix,omitempty"`
Defaults *Defaults `yaml:"defaults,omitempty" json:"defaults,omitempty"`
Env *Environment `yaml:"env,omitempty" json:"env,omitempty"`
Bootstrap []Step `yaml:"bootstrap,omitempty" json:"bootstrap,omitempty"`
Provision []Step `yaml:"provision,omitempty" json:"provision,omitempty"`
Setup []Step `yaml:"setup,omitempty" json:"setup,omitempty"`
Verify []Step `yaml:"verify,omitempty" json:"verify,omitempty"`
Post []Step `yaml:"post,omitempty" json:"post,omitempty"`
}
func Parse ¶
func Parse(data []byte) (*SetupConfig, error)
func ParseFile ¶
func ParseFile(filename string) (*SetupConfig, error)
func ParseFromReader ¶
func ParseFromReader(reader io.Reader) (*SetupConfig, error)
type SetupRunner ¶
type SetupRunner struct {
// contains filtered or unexported fields
}
func NewSetupRunner ¶
func NewSetupRunner(projectCtx *config.ProjectContext) *SetupRunner
func NewSetupRunnerWithDeps ¶
func NewSetupRunnerWithDeps( projectCtx *config.ProjectContext, store StorageInterface, apiClient APIClientInterface, ) *SetupRunner
func (*SetupRunner) Run ¶
func (r *SetupRunner) Run(config *SetupConfig) error
type Step ¶
type Step struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
If string `yaml:"if,omitempty" json:"if,omitempty"`
Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"`
CWD string `yaml:"cwd,omitempty" json:"cwd,omitempty"`
Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
EnvFromSecrets []string `yaml:"env_from_secrets,omitempty" json:"env_from_secrets,omitempty"`
OptionalSecrets bool `yaml:"optional_secrets,omitempty" json:"optional_secrets,omitempty"`
ContinueOnError bool `yaml:"continue_on_error,omitempty" json:"continue_on_error,omitempty"`
Retries *Retries `yaml:"retries,omitempty" json:"retries,omitempty"`
Run string `yaml:"run,omitempty" json:"run,omitempty"`
Print string `yaml:"print,omitempty" json:"print,omitempty"`
EnsurePackageManager *EnsurePackageManager `yaml:"ensure_package_manager,omitempty"`
EnsureTool *EnsureTool `yaml:"ensure_tool,omitempty" json:"ensure_tool,omitempty"`
EnsureRuntime *EnsureRuntime `yaml:"ensure_runtime,omitempty" json:"ensure_runtime,omitempty"`
EnsureDatabase *EnsureDatabase `yaml:"ensure_database,omitempty" json:"ensure_database,omitempty"`
AssertCommand string `yaml:"assert_command,omitempty" json:"assert_command,omitempty"`
AssertHTTP *AssertHTTP `yaml:"assert_http,omitempty" json:"assert_http,omitempty"`
}
type StorageInterface ¶
type ToolInstallConfig ¶
type ToolInstallConfig struct {
Brew *BrewInstall `yaml:"brew,omitempty" json:"brew,omitempty"`
Apt *AptInstall `yaml:"apt,omitempty" json:"apt,omitempty"`
Choco *ChocoInstall `yaml:"choco,omitempty" json:"choco,omitempty"`
FallbackURL string `yaml:"fallback_url,omitempty" json:"fallback_url,omitempty"`
Checksum string `yaml:"checksum,omitempty" json:"checksum,omitempty"`
}
type ValidationError ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type ValidationErrors ¶
type ValidationErrors []ValidationError
func (ValidationErrors) Error ¶
func (e ValidationErrors) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.