pipeline

package
v0.0.0-...-fd200ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDeploymentTimeoutSeconds = 30 * 60

Functions

func LookupSubscriptionID

func LookupSubscriptionID(ctx context.Context, subscriptionName string) (string, error)

func NewStepInspectScopes

func NewStepInspectScopes() map[string]StepInspectScope

func RunPipeline

func RunPipeline(pipeline *Pipeline, ctx context.Context, options *PipelineRunOptions) error

func RunResourceGroup

func RunResourceGroup(rg *ResourceGroup, ctx context.Context, options *PipelineRunOptions, executionTarget ExecutionTarget, outputs map[string]output) error

func RunStep

func RunStep(s Step, ctx context.Context, kubeconfigFile string, executionTarget ExecutionTarget, options *PipelineRunOptions, outPuts map[string]output) (output, error)

func ValidatePipelineSchema

func ValidatePipelineSchema(pipelineContent []byte) error

Types

type ARMStep

type ARMStep struct {
	StepMeta        `yaml:",inline"`
	Command         string     `yaml:"command,omitempty"`
	Variables       []Variable `yaml:"variables,omitempty"`
	Template        string     `yaml:"template,omitempty"`
	Parameters      string     `yaml:"parameters,omitempty"`
	DeploymentLevel string     `yaml:"deploymentLevel,omitempty"`
	OutputOnly      bool       `yaml:"outputOnly,omitempty"`
}

func NewARMStep

func NewARMStep(name string, template string, parameters string, deploymentLevel string) *ARMStep

func (*ARMStep) Description

func (s *ARMStep) Description() string

func (*ARMStep) WithDependsOn

func (s *ARMStep) WithDependsOn(dependsOn ...string) *ARMStep

func (*ARMStep) WithOutputOnly

func (s *ARMStep) WithOutputOnly() *ARMStep

func (*ARMStep) WithVariables

func (s *ARMStep) WithVariables(variables ...Variable) *ARMStep

type DelegateChildZoneStep

type DelegateChildZoneStep struct {
	StepMeta       `yaml:",inline"`
	ParentZoneName VariableRef `yaml:"parentZone"`
	ChildZoneName  VariableRef `yaml:"childZone"`
}

func (*DelegateChildZoneStep) Description

func (s *DelegateChildZoneStep) Description() string

type DryRun

type DryRun struct {
	Variables []Variable `yaml:"variables,omitempty"`
	Command   string     `yaml:"command,omitempty"`
}

type ExecutionTarget

type ExecutionTarget interface {
	KubeConfig(ctx context.Context) (string, error)
	GetSubscriptionID() string
	GetAkSClusterName() string
	GetResourceGroup() string
	GetRegion() string
}

type Input

type Input struct {
	Name string `yaml:"name"`
	Step string `yaml:"step"`
}

type InspectOptions

type InspectOptions struct {
	Scope          string
	Format         string
	Step           string
	Region         string
	Vars           config.Variables
	ScopeFunctions map[string]StepInspectScope
}

InspectOptions contains the options for the Inspect method

func NewInspectOptions

func NewInspectOptions(vars config.Variables, region, step, scope, format string) *InspectOptions

NewInspectOptions creates a new PipelineInspectOptions struct

type Pipeline

type Pipeline struct {
	ServiceGroup   string           `yaml:"serviceGroup"`
	RolloutName    string           `yaml:"rolloutName"`
	ResourceGroups []*ResourceGroup `yaml:"resourceGroups"`
	// contains filtered or unexported fields
}

func NewPipelineFromFile

func NewPipelineFromFile(pipelineFilePath string, vars config.Variables) (*Pipeline, error)

func NewPlainPipelineFromBytes

func NewPlainPipelineFromBytes(filepath string, bytes []byte) (*Pipeline, error)

func (*Pipeline) AbsoluteFilePath

func (p *Pipeline) AbsoluteFilePath(filePath string) (string, error)

func (*Pipeline) DeepCopy

func (p *Pipeline) DeepCopy(newPipelineFilePath string) (*Pipeline, error)

func (*Pipeline) Inspect

func (p *Pipeline) Inspect(ctx context.Context, options *InspectOptions, writer io.Writer) error

func (*Pipeline) PipelineFilePath

func (p *Pipeline) PipelineFilePath() string

func (*Pipeline) Validate

func (p *Pipeline) Validate() error

type PipelineRunOptions

type PipelineRunOptions struct {
	DryRun                   bool
	Step                     string
	Region                   string
	Vars                     config.Variables
	SubsciptionLookupFunc    subsciptionLookup
	NoPersist                bool
	DeploymentTimeoutSeconds int
}

type ResourceGroup

type ResourceGroup struct {
	Name         string `yaml:"name"`
	Subscription string `yaml:"subscription"`
	AKSCluster   string `yaml:"aksCluster,omitempty"`
	Steps        []Step `yaml:"steps"`
}

func (*ResourceGroup) Validate

func (rg *ResourceGroup) Validate() error

type SetCertificateIssuerStep

type SetCertificateIssuerStep struct {
	StepMeta     `yaml:",inline"`
	VaultBaseUrl VariableRef `yaml:"vaultBaseUrl"`
	Provider     VariableRef `yaml:"provider"`
}

func (*SetCertificateIssuerStep) Description

func (s *SetCertificateIssuerStep) Description() string

type ShellStep

type ShellStep struct {
	StepMeta  `yaml:",inline"`
	Command   string     `yaml:"command,omitempty"`
	Variables []Variable `yaml:"variables,omitempty"`
	DryRun    DryRun     `yaml:"dryRun,omitempty"`
	// contains filtered or unexported fields
}

func NewShellStep

func NewShellStep(name string, command string) *ShellStep

func (*ShellStep) Description

func (s *ShellStep) Description() string

func (*ShellStep) WithDependsOn

func (s *ShellStep) WithDependsOn(dependsOn ...string) *ShellStep

func (*ShellStep) WithDryRun

func (s *ShellStep) WithDryRun(dryRun DryRun) *ShellStep

func (*ShellStep) WithOutputFunc

func (s *ShellStep) WithOutputFunc(outputFunc outPutHandler) *ShellStep

func (*ShellStep) WithVariables

func (s *ShellStep) WithVariables(variables ...Variable) *ShellStep

type Step

type Step interface {
	StepName() string
	ActionType() string
	Description() string
	Dependencies() []string
}

type StepInspectScope

type StepInspectScope func(Step, *InspectOptions, io.Writer) error

type StepMeta

type StepMeta struct {
	Name      string   `yaml:"name"`
	Action    string   `yaml:"action"`
	DependsOn []string `yaml:"dependsOn,omitempty"`
}

func (*StepMeta) ActionType

func (m *StepMeta) ActionType() string

func (*StepMeta) Dependencies

func (m *StepMeta) Dependencies() []string

func (*StepMeta) StepName

func (m *StepMeta) StepName() string

type Variable

type Variable struct {
	Name      string `yaml:"name"`
	ConfigRef string `yaml:"configRef,omitempty"`
	Value     string `yaml:"value,omitempty"`
	Input     *Input `yaml:"input,omitempty"`
}

type VariableRef

type VariableRef struct {
	ConfigRef string `yaml:"configRef,omitempty"`
	Value     string `yaml:"value,omitempty"`
	Input     *Input `yaml:"input,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL