tracks

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRE_TRACK_NAME     = "_pretrack" // The name of the directory for the pretrack
	DEFAULT_TRACK_NAME = "default"   // The name of the default top-level track
)

Variables

This section is empty.

Functions

func AppendPreTrackOutputsToDefaultStepOutputVariables

func AppendPreTrackOutputsToDefaultStepOutputVariables(defaultStepOutputVariables map[string]map[string]string, preTrackOutput *Output, regionDeployType config.RegionDeployType, region string) map[string]map[string]string

func AppendTrackOutput

func AppendTrackOutput(trackOutputVariables map[string]map[string]string, output config.StepOutput) map[string]map[string]string

Adds step outputs variables to the track output variables map K = Step Name, V = map[StepOutputVarName: StepOutputVarValue]

func ExecuteDeployTrack

func ExecuteDeployTrack(execution Execution, cfg config.Config, t Track, out chan<- Output)

ExecuteDeployTrack is for executing a single track across regions

func ExecuteDeployTrackRegion

func ExecuteDeployTrackRegion(in <-chan RegionExecution, out chan<- RegionExecution)

func ExecuteDestroyTrack

func ExecuteDestroyTrack(execution Execution, cfg config.Config, t Track, out chan<- Output)

ExecuteDestroyTrack is a helper function for destroying a track

func ExecuteDestroyTrackRegion

func ExecuteDestroyTrackRegion(in <-chan RegionExecution, out chan<- RegionExecution)

func ExecuteStepImpl

func ExecuteStepImpl(region string, regionDeployType config.RegionDeployType,
	logger *logrus.Entry, fs afero.Fs, defaultStepOutputVariables map[string]map[string]string, stepProgression int,
	s config.Step, out chan<- config.Step, destroy bool)

Types

type DirectoryBasedTracker

type DirectoryBasedTracker struct {
	Log *logrus.Entry
	Fs  afero.Fs
}

DirectoryBasedTracker implements the Tracker interface

func (DirectoryBasedTracker) ExecuteTracks

func (tracker DirectoryBasedTracker) ExecuteTracks(cfg config.Config) (output Stage)

ExecuteTracks executes all tracks in parallel. If a _pretrack exists, this is executed before all other tracks.

func (DirectoryBasedTracker) GatherTracks

func (tracker DirectoryBasedTracker) GatherTracks(config config.Config) (tracks []Track)

GatherTracks gets all tracks that should be executed based on the directory structure

type ExecuteStepFunc

type ExecuteStepFunc func(region string, regionDeployType config.RegionDeployType, entry *logrus.Entry, fs afero.Fs, defaultStepOutputVariables map[string]map[string]string, stepProgression int,
	s config.Step, out chan<- config.Step, destroy bool)
var ExecuteStep ExecuteStepFunc = ExecuteStepImpl

type ExecuteTrackFunc

type ExecuteTrackFunc func(execution Execution, cfg config.Config, t Track, out chan<- Output)

ExecuteTrackFunc facilitates track executions across multiple regions and RegionDeployTypes (e.g. Primary us-east-1 and regional us-*)

type ExecuteTrackRegionFunc

type ExecuteTrackRegionFunc func(in <-chan RegionExecution, out chan<- RegionExecution)

ExecuteTrackRegionFunc executes a track within a single region and RegionDeployType (e.g. primary/us-east-1 or regional/us-east-2)

type Execution

type Execution struct {
	Logger                              *logrus.Entry
	Fs                                  afero.Fs
	Output                              ExecutionOutput
	DefaultExecutionStepOutputVariables map[string]map[string]map[string]string
	PreTrackOutput                      *Output
}

type ExecutionOutput

type ExecutionOutput struct {
	Name                string
	Dir                 string
	ExecutedCount       int
	SkippedCount        int
	FailureCount        int
	FailedTestCount     int
	Steps               map[string]config.Step
	FailedSteps         []config.Step
	StepOutputVariables map[string]map[string]string // Output variables across all steps in the track. A map where K={step name} and V={map[outputVarName: outputVarVal]}
}

TrackOutput represents the output from a track execution

type Output

type Output struct {
	Name                       string
	PrimaryStepOutputVariables map[string]map[string]string
	Executions                 []RegionExecution
}

type RegionExecution

type RegionExecution struct {
	TrackName                  string
	TrackDir                   string
	TrackStepProgressionsCount int
	TrackStepsWithTestsCount   int
	TrackOrderedSteps          map[int][]config.Step
	Logger                     *logrus.Entry
	Fs                         afero.Fs
	Output                     ExecutionOutput
	Region                     string
	RegionDeployType           config.RegionDeployType
	PrimaryOutput              ExecutionOutput // This value is only set when regiondeploytype == regional
	DefaultStepOutputVariables map[string]map[string]string
}

type Stage

type Stage struct {
	Tracks map[string]Track
}

Stage represents the outputs of tracks

type Track

type Track struct {
	Name                        string
	Dir                         string
	StepProgressionsCount       int
	StepsCount                  int
	StepsWithTestsCount         int
	StepsWithRegionalTestsCount int
	RegionalDeployment          bool // If true at least one step is configured to deploy to multiple region
	OrderedSteps                map[int][]config.Step
	Output                      Output
	DestroyOutput               Output
	IsPreTrack                  bool // If true, this is a PreTrack, meaning it should be run before all other tracks
	IsDefaultTrack              bool // If true, this track represents steps contained in a standalone, top-level track
	Skipped                     bool // Indicates that the track was skipped. This will be for non-pretrack tracks if the pretrack fails
}

Track represents a delivery framework track (unit of functionality)

type Tracker

type Tracker interface {
	GatherTracks(config config.Config) (tracks []Track)
	ExecuteTracks(config config.Config) (output Stage)
}

Tracker is an interface for working with tracks

Jump to

Keyboard shortcuts

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