pipelines

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: AGPL-3.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBatonNotPresent indicates the wrong type of data structure passed between pipelines. Internal / Programmatic error
	ErrBatonNotPresent = errors.New("right data structure not present between pipelines")
)

Functions

func CopyFilesToImage

func CopyFilesToImage(myBaton *baton.Baton) ciutil.OnWriterFunc

CopyFilesToImage copies the files from dockerdirectory to image

func GetDockerImageTag

func GetDockerImageTag(myBaton *baton.Baton, stage string) string

GetDockerImageTag returns the image tag for the given information

Types

type BuildID

type BuildID string

BuildID represents the identification of a given build.

func GetTargetBuildID added in v0.1.6

func GetTargetBuildID(buildID BuildID, suffix string) BuildID

GetTargetBuildID returns the buildID with the suffix appended

type OnBuildContextFunc

type OnBuildContextFunc func(buildRoot string) (PipelineRunExecFunc, error)

OnBuildContextFunc represents a function to act on the given build context

func GetBuildContextFunc

func GetBuildContextFunc(createDockerClientFunc cidocker.CreateDockerClientFunc,
	imageBuildOptions *types.ImageBuildOptions,
	result *types.BuildResult) OnBuildContextFunc

type OnGenericFunc

type OnGenericFunc func() error

OnGenericFunc represents a function that returns an error or otherwise

type OnProfileFunc

type OnProfileFunc func(profile *Profile) error

OnProfileFunc is a function executed on the receipt of a given profile

type Pipeline

type Pipeline interface {
	// Runs a bunch of processes based on the given config
	Run(config *config.Config, buildID BuildID, myBaton *baton.Baton) PipelineRunReturnFunc

	// GetNames returns the names of the pipelines . Returns a tuple , a key and a long descriptive name
	GetNames() (key string, longName string)
}

Pipeline builds and executes a given set of commands

type PipelineRunExecFunc

type PipelineRunExecFunc func(ctx context.Context, log logger.Log) error

PipelineRunExecFunc represents the functor to return after a pipeline run

func BuildDockerImage

func BuildDockerImage(buildDirectory string, prefix string,
	fnCreateBuildContext ciutil.OnDirFunc, fnOnBuildContext OnBuildContextFunc) PipelineRunExecFunc

BuildDockerImage creates the temporary directory for buildContext, and builds a docker image from the same directory as a build context

func RunOnClientFunc

func RunOnClientFunc(createDockerClientFunc cidocker.CreateDockerClientFunc,
	fnOnClient cidocker.OnClientFunc) PipelineRunExecFunc

RunOnClientFunc runs the given OnClientFunc on the system

type PipelineRunReturnFunc

type PipelineRunReturnFunc func(ctx context.Context, log logger.Log) (BuildID, error)

PipelineRunReturnFunc represents the functor to return after a pipeline run

type Profile

type Profile struct {
	Name string

	Begin time.Time

	End time.Time

	Duration time.Duration
}

Profile represents the start and end time of a profile

func NewProfile

func NewProfile(name string) *Profile

NewProfile creates a new profile

func RunProfile

func RunProfile(name string, fnOnGenericFunc OnGenericFunc) (*Profile, error)

RunProfile returns a profile along with the status of the function

func (*Profile) Start

func (profile *Profile) Start()

func (*Profile) Stop

func (profile *Profile) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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