build

package
v1.1.22-fix14 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 42 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageLogProcessStyle

func ImageLogProcessStyle(isArtifact bool) *style.Style

func ImageLogTagStyle

func ImageLogTagStyle(isArtifact bool) *style.Style

Types

type BaseImageType

type BaseImageType string
const (
	ImageFromRegistryAsBaseImage BaseImageType = "ImageFromRegistryBaseImage"
	StageAsBaseImage             BaseImageType = "StageBaseImage"
)

type BasePhase

type BasePhase struct {
	Conveyor *Conveyor
}

type BuildAndPublishOptions

type BuildAndPublishOptions struct {
	BuildStagesOptions
	PublishImagesOptions

	DryRun bool
}

type BuildPhase

type BuildPhase struct {
	BasePhase
	BuildPhaseOptions

	StagesIterator              *StagesIterator
	ShouldAddManagedImageRecord bool
}

func NewBuildPhase

func NewBuildPhase(c *Conveyor, opts BuildPhaseOptions) *BuildPhase

func (*BuildPhase) AfterImageStages

func (phase *BuildPhase) AfterImageStages(ctx context.Context, img *Image) error

func (*BuildPhase) AfterImages

func (phase *BuildPhase) AfterImages(_ context.Context) error

func (*BuildPhase) BeforeImageStages

func (phase *BuildPhase) BeforeImageStages(_ context.Context, img *Image) error

func (*BuildPhase) BeforeImages

func (phase *BuildPhase) BeforeImages(_ context.Context) error

func (*BuildPhase) Clone added in v1.1.23

func (phase *BuildPhase) Clone() Phase

func (*BuildPhase) ImageProcessingShouldBeStopped

func (phase *BuildPhase) ImageProcessingShouldBeStopped(_ context.Context, img *Image) bool

func (*BuildPhase) Name

func (phase *BuildPhase) Name() string

func (*BuildPhase) OnImageStage

func (phase *BuildPhase) OnImageStage(ctx context.Context, img *Image, stg stage.Interface) error

type BuildPhaseOptions

type BuildPhaseOptions struct {
	ShouldBeBuiltMode bool
	ImageBuildOptions container_runtime.BuildOptions
	IntrospectOptions IntrospectOptions
}

type BuildStagesOptions

type BuildStagesOptions struct {
	ImageBuildOptions container_runtime.BuildOptions
	IntrospectOptions
}

type Conveyor

type Conveyor struct {
	ContainerRuntime container_runtime.ContainerRuntime

	ImagesRepo         storage.ImagesRepo
	StorageLockManager storage.LockManager
	StagesManager      *stages_manager.StagesManager

	ConveyorOptions
	// contains filtered or unexported fields
}

func NewConveyor

func NewConveyor(werfConfig *config.WerfConfig, imageNamesToProcess []string, projectDir, baseTmpDir, sshAuthSock string, containerRuntime container_runtime.ContainerRuntime, stagesManager *stages_manager.StagesManager, imagesRepo storage.ImagesRepo, storageLockManager storage.LockManager, opts ConveyorOptions) (*Conveyor, error)

func (*Conveyor) AppendOnTerminateFunc

func (c *Conveyor) AppendOnTerminateFunc(f func() error)

func (*Conveyor) BuildAndPublish

func (c *Conveyor) BuildAndPublish(ctx context.Context, opts BuildAndPublishOptions) error

func (*Conveyor) BuildStages

func (c *Conveyor) BuildStages(ctx context.Context, opts BuildStagesOptions) error

func (*Conveyor) GetBaseImagesRepoErrCache added in v1.1.23

func (c *Conveyor) GetBaseImagesRepoErrCache(key string) error

func (*Conveyor) GetBaseImagesRepoIdsCache added in v1.1.23

func (c *Conveyor) GetBaseImagesRepoIdsCache(key string) string

func (*Conveyor) GetGitRepoCaches added in v1.1.23

func (c *Conveyor) GetGitRepoCaches() map[string]*stage.GitRepoCache

func (*Conveyor) GetImage

func (c *Conveyor) GetImage(name string) *Image

func (*Conveyor) GetImageContentSignature

func (c *Conveyor) GetImageContentSignature(imageName string) string

func (*Conveyor) GetImageIDForImageStage

func (c *Conveyor) GetImageIDForImageStage(imageName, stageName string) string

func (*Conveyor) GetImageIDForLastImageStage

func (c *Conveyor) GetImageIDForLastImageStage(imageName string) string

func (*Conveyor) GetImageInfoGetters

func (c *Conveyor) GetImageInfoGetters(configImages []*config.StapelImage, configImagesFromDockerfile []*config.ImageFromDockerfile, commonTag string, tagStrategy tag_strategy.TagStrategy, withoutRegistry bool) []images_manager.ImageInfoGetter

func (*Conveyor) GetImageNameForImageStage

func (c *Conveyor) GetImageNameForImageStage(imageName, stageName string) string

func (*Conveyor) GetImageNameForLastImageStage

func (c *Conveyor) GetImageNameForLastImageStage(imageName string) string

func (*Conveyor) GetImageStageContentSignature

func (c *Conveyor) GetImageStageContentSignature(imageName, stageName string) string

func (*Conveyor) GetImageTmpDir

func (c *Conveyor) GetImageTmpDir(imageName string) string

func (*Conveyor) GetImportServer

func (c *Conveyor) GetImportServer(ctx context.Context, imageName, stageName string) (import_server.ImportServer, error)

func (*Conveyor) GetLocalGitRepo

func (c *Conveyor) GetLocalGitRepo() *git_repo.Local

func (*Conveyor) GetLocalGitRepoVirtualMergeOptions

func (c *Conveyor) GetLocalGitRepoVirtualMergeOptions() stage.VirtualMergeOptions

func (*Conveyor) GetOrCreateGitRepoCache added in v1.1.23

func (c *Conveyor) GetOrCreateGitRepoCache(gitRepoName string) *stage.GitRepoCache

func (*Conveyor) GetOrCreateStageImage

func (c *Conveyor) GetOrCreateStageImage(fromImage *container_runtime.StageImage, name string) *container_runtime.StageImage

func (*Conveyor) GetProjectRepoCommit

func (c *Conveyor) GetProjectRepoCommit(ctx context.Context) (string, error)

func (*Conveyor) GetRemoteGitRepo added in v1.1.23

func (c *Conveyor) GetRemoteGitRepo(key string) *git_repo.Remote

func (*Conveyor) GetStageImage

func (c *Conveyor) GetStageImage(name string) *container_runtime.StageImage

func (*Conveyor) GetStageSignatureMutex added in v1.1.23

func (c *Conveyor) GetStageSignatureMutex(stage string) *sync.Mutex

func (*Conveyor) Init

func (c *Conveyor) Init() error

func (*Conveyor) IsBaseImagesRepoErrCacheExist added in v1.1.23

func (c *Conveyor) IsBaseImagesRepoErrCacheExist(key string) bool

func (*Conveyor) IsBaseImagesRepoIdsCacheExist added in v1.1.23

func (c *Conveyor) IsBaseImagesRepoIdsCacheExist(key string) bool

func (*Conveyor) PublishImages

func (c *Conveyor) PublishImages(ctx context.Context, opts PublishImagesOptions) error

func (*Conveyor) SetBaseImagesRepoErrCache added in v1.1.23

func (c *Conveyor) SetBaseImagesRepoErrCache(key string, err error)

func (*Conveyor) SetBaseImagesRepoIdsCache added in v1.1.23

func (c *Conveyor) SetBaseImagesRepoIdsCache(key, value string)

func (*Conveyor) SetLocalGitRepo

func (c *Conveyor) SetLocalGitRepo(repo *git_repo.Local)

func (*Conveyor) SetRemoteGitRepo added in v1.1.23

func (c *Conveyor) SetRemoteGitRepo(key string, repo *git_repo.Remote)

func (*Conveyor) SetStageImage

func (c *Conveyor) SetStageImage(stageImage *container_runtime.StageImage)

func (*Conveyor) ShouldBeBuilt

func (c *Conveyor) ShouldBeBuilt(ctx context.Context, opts ShouldBeBuiltOptions) error

func (*Conveyor) Terminate

func (c *Conveyor) Terminate(ctx context.Context) error

func (*Conveyor) UnsetStageImage

func (c *Conveyor) UnsetStageImage(name string)

type ConveyorOptions

type ConveyorOptions struct {
	Parallel                        bool
	ParallelTasksLimit              int64
	LocalGitRepoVirtualMergeOptions stage.VirtualMergeOptions
	GitUnshallow                    bool
	AllowGitShallowClone            bool
}

type ConveyorWithRetryWrapper

type ConveyorWithRetryWrapper struct {
	WerfConfig          *config.WerfConfig
	ImageNamesToProcess []string
	ProjectDir          string
	BaseTmpDir          string
	SshAuthSock         string
	ContainerRuntime    container_runtime.ContainerRuntime
	StagesManager       *stages_manager.StagesManager
	ImagesRepo          storage.ImagesRepo
	StorageLockManager  storage.LockManager

	ConveyorOptions ConveyorOptions
}

func NewConveyorWithRetryWrapper

func NewConveyorWithRetryWrapper(werfConfig *config.WerfConfig, imageNamesToProcess []string, projectDir, baseTmpDir, sshAuthSock string, containerRuntime container_runtime.ContainerRuntime, stagesManager *stages_manager.StagesManager, imagesRepo storage.ImagesRepo, storageLockManager storage.LockManager, opts ConveyorOptions) *ConveyorWithRetryWrapper

func (*ConveyorWithRetryWrapper) Terminate

func (wrapper *ConveyorWithRetryWrapper) Terminate() error

func (*ConveyorWithRetryWrapper) WithRetryBlock

func (wrapper *ConveyorWithRetryWrapper) WithRetryBlock(ctx context.Context, f func(c *Conveyor) error) error

type Image

type Image struct {
	// contains filtered or unexported fields
}

func (*Image) FetchBaseImage

func (i *Image) FetchBaseImage(ctx context.Context, c *Conveyor) error

func (*Image) GetBaseImage

func (i *Image) GetBaseImage() *container_runtime.StageImage

func (*Image) GetContentSignature

func (i *Image) GetContentSignature() string

func (*Image) GetLastNonEmptyStage

func (i *Image) GetLastNonEmptyStage() stage.Interface

func (*Image) GetLogName

func (i *Image) GetLogName() string

func (*Image) GetName

func (i *Image) GetName() string

func (*Image) GetStage

func (i *Image) GetStage(name stage.StageName) stage.Interface

func (*Image) GetStages

func (i *Image) GetStages() []stage.Interface

func (*Image) LogDetailedName

func (i *Image) LogDetailedName() string

func (*Image) LogName

func (i *Image) LogName() string

func (*Image) LogProcessStyle

func (i *Image) LogProcessStyle() *style.Style

func (*Image) LogTagStyle

func (i *Image) LogTagStyle() *style.Style

func (*Image) SetContentSignature

func (i *Image) SetContentSignature(sig string)

func (*Image) SetLastNonEmptyStage

func (i *Image) SetLastNonEmptyStage(stg stage.Interface)

func (*Image) SetStages

func (i *Image) SetStages(stages []stage.Interface)

func (*Image) SetupBaseImage

func (i *Image) SetupBaseImage(c *Conveyor)

type IntrospectOptions

type IntrospectOptions struct {
	Targets []IntrospectTarget
}

func (*IntrospectOptions) ImageStageShouldBeIntrospected

func (opts *IntrospectOptions) ImageStageShouldBeIntrospected(imageName, stageName string) bool

type IntrospectTarget

type IntrospectTarget struct {
	ImageName string
	StageName string
}

type Phase

type Phase interface {
	Name() string
	BeforeImages(ctx context.Context) error
	AfterImages(ctx context.Context) error
	BeforeImageStages(ctx context.Context, img *Image) error
	OnImageStage(ctx context.Context, img *Image, stg stage.Interface) error
	AfterImageStages(ctx context.Context, img *Image) error
	ImageProcessingShouldBeStopped(ctx context.Context, img *Image) bool
	Clone() Phase
}

type PublishImagesOptions

type PublishImagesOptions struct {
	ImagesToPublish []string
	TagOptions

	PublishReportPath   string
	PublishReportFormat PublishReportFormat
}

type PublishImagesPhase

type PublishImagesPhase struct {
	BasePhase
	ImagesToPublish      []string
	TagsByScheme         map[tag_strategy.TagStrategy][]string
	TagByStagesSignature bool
	ImagesRepo           storage.ImagesRepo

	PublishReport       *PublishReport
	PublishReportPath   string
	PublishReportFormat PublishReportFormat
}

func NewPublishImagesPhase

func NewPublishImagesPhase(c *Conveyor, imagesRepo storage.ImagesRepo, opts PublishImagesOptions) *PublishImagesPhase

func (*PublishImagesPhase) AfterImageStages

func (phase *PublishImagesPhase) AfterImageStages(ctx context.Context, img *Image) error

func (*PublishImagesPhase) AfterImages

func (phase *PublishImagesPhase) AfterImages(ctx context.Context) error

func (*PublishImagesPhase) BeforeImageStages

func (phase *PublishImagesPhase) BeforeImageStages(ctx context.Context, img *Image) error

func (*PublishImagesPhase) BeforeImages

func (phase *PublishImagesPhase) BeforeImages(ctx context.Context) error

func (*PublishImagesPhase) Clone added in v1.1.23

func (phase *PublishImagesPhase) Clone() Phase

func (*PublishImagesPhase) ImageProcessingShouldBeStopped

func (phase *PublishImagesPhase) ImageProcessingShouldBeStopped(_ context.Context, _ *Image) bool

func (*PublishImagesPhase) Name

func (phase *PublishImagesPhase) Name() string

func (*PublishImagesPhase) OnImageStage

func (phase *PublishImagesPhase) OnImageStage(ctx context.Context, img *Image, stg stage.Interface) error

type PublishReport

type PublishReport struct {
	Images map[string]PublishReportImageRecord
}

type PublishReportFormat

type PublishReportFormat string
const (
	PublishReportJSON PublishReportFormat = "json"
)

type PublishReportImageRecord

type PublishReportImageRecord struct {
	WerfImageName string
	DockerRepo    string
	DockerTag     string
	DockerImageID string
}

type ShouldBeBuiltOptions

type ShouldBeBuiltOptions struct {
	FetchLastStage bool
}

type StagesIterator

type StagesIterator struct {
	Conveyor *Conveyor

	PrevStage                  stage.Interface
	PrevNonEmptyStage          stage.Interface
	PrevBuiltStage             stage.Interface
	PrevNonEmptyStageImageSize int64
}

func NewStagesIterator

func NewStagesIterator(conveyor *Conveyor) *StagesIterator

func (*StagesIterator) GetPrevBuiltImage

func (iterator *StagesIterator) GetPrevBuiltImage(img *Image, stg stage.Interface) container_runtime.ImageInterface

func (*StagesIterator) GetPrevImage

func (iterator *StagesIterator) GetPrevImage(img *Image, stg stage.Interface) container_runtime.ImageInterface

func (*StagesIterator) OnImageStage

func (iterator *StagesIterator) OnImageStage(ctx context.Context, img *Image, stg stage.Interface, onImageStageFunc func(img *Image, stg stage.Interface, isEmpty bool) error) error

type TagOptions

type TagOptions struct {
	CustomTags           []string
	TagsByGitTag         []string
	TagsByGitBranch      []string
	TagsByGitCommit      []string
	TagByStagesSignature bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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