stage

package
v1.0.0-beta.13 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const GitArchiveResetCommitRegex = "(\\[werf reset\\])|(\\[reset werf\\])"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStage

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

func (*BaseStage) AfterImageSyncDockerStateHook

func (s *BaseStage) AfterImageSyncDockerStateHook(_ Conveyor) error

func (*BaseStage) GetDependencies

func (s *BaseStage) GetDependencies(_ Conveyor, _ imagePkg.ImageInterface) (string, error)

func (*BaseStage) GetGitMappings

func (s *BaseStage) GetGitMappings() []*GitMapping

func (*BaseStage) GetImage

func (s *BaseStage) GetImage() imagePkg.ImageInterface

func (*BaseStage) GetSignature

func (s *BaseStage) GetSignature() string

func (*BaseStage) IsEmpty

func (s *BaseStage) IsEmpty(_ Conveyor, _ imagePkg.ImageInterface) (bool, error)

func (*BaseStage) LogDetailedName

func (s *BaseStage) LogDetailedName() string

func (*BaseStage) Name

func (s *BaseStage) Name() StageName

func (*BaseStage) PreRunHook

func (s *BaseStage) PreRunHook(_ Conveyor) error

func (*BaseStage) PrepareImage

func (s *BaseStage) PrepareImage(_ Conveyor, prevBuiltImage, image imagePkg.ImageInterface) error

func (*BaseStage) SetGitMappings

func (s *BaseStage) SetGitMappings(gitMappings []*GitMapping)

func (*BaseStage) SetImage

func (s *BaseStage) SetImage(image imagePkg.ImageInterface)

func (*BaseStage) SetSignature

func (s *BaseStage) SetSignature(signature string)

func (*BaseStage) ShouldBeReset

func (s *BaseStage) ShouldBeReset(builtImage imagePkg.ImageInterface) (bool, error)

type BeforeInstallStage

type BeforeInstallStage struct {
	*UserStage
}

func GenerateBeforeInstallStage

func GenerateBeforeInstallStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *BeforeInstallStage

func (*BeforeInstallStage) GetDependencies

func (s *BeforeInstallStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*BeforeInstallStage) PrepareImage

func (s *BeforeInstallStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type BeforeSetupStage

type BeforeSetupStage struct {
	*UserWithGitPatchStage
}

func GenerateBeforeSetupStage

func GenerateBeforeSetupStage(imageBaseConfig *config.ImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *NewBaseStageOptions) *BeforeSetupStage

func (*BeforeSetupStage) GetDependencies

func (s *BeforeSetupStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*BeforeSetupStage) PrepareImage

func (s *BeforeSetupStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type ContainerFileDescriptor

type ContainerFileDescriptor struct {
	FilePath          string
	ContainerFilePath string
}

func (*ContainerFileDescriptor) Open

func (f *ContainerFileDescriptor) Open(flag int, perm os.FileMode) (*os.File, error)

type Conveyor

type Conveyor interface {
	GetImageLatestStageSignature(imageName string) string
	GetImageLatestStageImageName(imageName string) string
	SetBuildingGitStage(imageName string, stageName StageName)
	GetBuildingGitStage(imageName string) StageName
}

type DockerInstructionsStage

type DockerInstructionsStage struct {
	*BaseStage
	// contains filtered or unexported fields
}

func GenerateDockerInstructionsStage

func GenerateDockerInstructionsStage(imageConfig *config.Image, baseStageOptions *NewBaseStageOptions) *DockerInstructionsStage

func (*DockerInstructionsStage) GetDependencies

func (s *DockerInstructionsStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*DockerInstructionsStage) PrepareImage

func (s *DockerInstructionsStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type FromStage

type FromStage struct {
	*BaseStage
	// contains filtered or unexported fields
}

func GenerateFromStage

func GenerateFromStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *FromStage

func (*FromStage) GetDependencies

func (s *FromStage) GetDependencies(_ Conveyor, prevImage image.ImageInterface) (string, error)

func (*FromStage) PrepareImage

func (s *FromStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type GitArchiveStage

type GitArchiveStage struct {
	*GitStage

	ArchivesDir          string
	ContainerArchivesDir string
}

func NewGitArchiveStage

func NewGitArchiveStage(gitArchiveStageOptions *NewGitArchiveStageOptions, baseStageOptions *NewBaseStageOptions) *GitArchiveStage

func (*GitArchiveStage) GetDependencies

func (s *GitArchiveStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*GitArchiveStage) PrepareImage

func (s *GitArchiveStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type GitCacheStage

type GitCacheStage struct {
	*GitPatchStage
}

func NewGitCacheStage

func NewGitCacheStage(gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *NewBaseStageOptions) *GitCacheStage

func (*GitCacheStage) GetDependencies

func (s *GitCacheStage) GetDependencies(_ Conveyor, prevImage image.ImageInterface) (string, error)

type GitLatestPatchStage

type GitLatestPatchStage struct {
	*GitPatchStage
}

func NewGitLatestPatchStage

func NewGitLatestPatchStage(gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *NewBaseStageOptions) *GitLatestPatchStage

func (*GitLatestPatchStage) GetDependencies

func (s *GitLatestPatchStage) GetDependencies(_ Conveyor, prevImage image.ImageInterface) (string, error)

func (*GitLatestPatchStage) IsEmpty

func (s *GitLatestPatchStage) IsEmpty(c Conveyor, prevBuiltImage image.ImageInterface) (bool, error)

type GitMapping

type GitMapping struct {
	GitRepoInterface git_repo.GitRepo
	LocalGitRepo     *git_repo.Local
	RemoteGitRepo    *git_repo.Remote

	Name               string
	As                 string
	Branch             string
	Tag                string
	Commit             string
	To                 string
	RepoPath           string
	Cwd                string
	Owner              string
	Group              string
	IncludePaths       []string
	ExcludePaths       []string
	StagesDependencies map[StageName][]string

	PatchesDir           string
	ContainerPatchesDir  string
	ArchivesDir          string
	ContainerArchivesDir string
}

func (*GitMapping) AddGitCommitToImageLabels

func (gp *GitMapping) AddGitCommitToImageLabels(image image.ImageInterface, commit string)

func (*GitMapping) ApplyArchiveCommand

func (gp *GitMapping) ApplyArchiveCommand(image image.ImageInterface) error

func (*GitMapping) ApplyPatchCommand

func (gp *GitMapping) ApplyPatchCommand(prevBuiltImage, image image.ImageInterface) error

func (*GitMapping) GetCommitsToPatch

func (gp *GitMapping) GetCommitsToPatch(prevBuiltImage image.ImageInterface) (string, string, error)

func (*GitMapping) GetFullName

func (gp *GitMapping) GetFullName() string

func (*GitMapping) GetGitCommitFromImageLabels

func (gp *GitMapping) GetGitCommitFromImageLabels(builtImage image.ImageInterface) string

func (*GitMapping) GetParamshash

func (gp *GitMapping) GetParamshash() string

func (*GitMapping) GitRepo

func (gp *GitMapping) GitRepo() git_repo.GitRepo

func (*GitMapping) ImageGitCommitLabel

func (gp *GitMapping) ImageGitCommitLabel() string

func (*GitMapping) IsEmpty

func (gp *GitMapping) IsEmpty() (bool, error)

func (*GitMapping) IsLocal

func (gp *GitMapping) IsLocal() bool

func (*GitMapping) IsPatchEmpty

func (gp *GitMapping) IsPatchEmpty(prevBuiltImage image.ImageInterface) (bool, error)

func (*GitMapping) LatestCommit

func (gp *GitMapping) LatestCommit() (string, error)

func (*GitMapping) PatchSize

func (gp *GitMapping) PatchSize(fromCommit string) (int64, error)

func (*GitMapping) StageDependenciesChecksum

func (gp *GitMapping) StageDependenciesChecksum(stageName StageName) (string, error)

type GitPatchStage

type GitPatchStage struct {
	*GitStage

	PatchesDir           string
	ArchivesDir          string
	ContainerPatchesDir  string
	ContainerArchivesDir string
}

func (*GitPatchStage) IsEmpty

func (s *GitPatchStage) IsEmpty(c Conveyor, prevBuiltImage image.ImageInterface) (bool, error)

func (*GitPatchStage) PrepareImage

func (s *GitPatchStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type GitStage

type GitStage struct {
	*BaseStage
}

func (*GitStage) AfterImageSyncDockerStateHook

func (s *GitStage) AfterImageSyncDockerStateHook(c Conveyor) error

func (*GitStage) IsEmpty

func (s *GitStage) IsEmpty(_ Conveyor, _ image.ImageInterface) (bool, error)

func (*GitStage) PrepareImage

func (s *GitStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type ImportsAfterInstallStage

type ImportsAfterInstallStage struct {
	*ImportsStage
}

func GenerateImportsAfterInstallStage

func GenerateImportsAfterInstallStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *ImportsAfterInstallStage

type ImportsAfterSetupStage

type ImportsAfterSetupStage struct {
	*ImportsStage
}

func GenerateImportsAfterSetupStage

func GenerateImportsAfterSetupStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *ImportsAfterSetupStage

type ImportsBeforeInstallStage

type ImportsBeforeInstallStage struct {
	*ImportsStage
}

func GenerateImportsBeforeInstallStage

func GenerateImportsBeforeInstallStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *ImportsBeforeInstallStage

type ImportsBeforeSetupStage

type ImportsBeforeSetupStage struct {
	*ImportsStage
}

func GenerateImportsBeforeSetupStage

func GenerateImportsBeforeSetupStage(imageBaseConfig *config.ImageBase, baseStageOptions *NewBaseStageOptions) *ImportsBeforeSetupStage

type ImportsStage

type ImportsStage struct {
	*BaseStage
	// contains filtered or unexported fields
}

func (*ImportsStage) GetDependencies

func (s *ImportsStage) GetDependencies(c Conveyor, _ imagePkg.ImageInterface) (string, error)

func (*ImportsStage) PreRunHook

func (s *ImportsStage) PreRunHook(c Conveyor) error

func (*ImportsStage) PrepareImage

func (s *ImportsStage) PrepareImage(c Conveyor, _, image imagePkg.ImageInterface) error

type InstallStage

type InstallStage struct {
	*UserWithGitPatchStage
}

func GenerateInstallStage

func GenerateInstallStage(imageBaseConfig *config.ImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *NewBaseStageOptions) *InstallStage

func (*InstallStage) GetDependencies

func (s *InstallStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*InstallStage) PrepareImage

func (s *InstallStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type Interface

type Interface interface {
	Name() StageName
	LogDetailedName() string

	IsEmpty(c Conveyor, prevBuiltImage image.ImageInterface) (bool, error)
	ShouldBeReset(builtImage image.ImageInterface) (bool, error)

	GetDependencies(c Conveyor, prevImage image.ImageInterface) (string, error)

	PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

	AfterImageSyncDockerStateHook(Conveyor) error
	PreRunHook(Conveyor) error

	SetSignature(signature string)
	GetSignature() string

	SetImage(image.ImageInterface)
	GetImage() image.ImageInterface

	SetGitMappings([]*GitMapping)
	GetGitMappings() []*GitMapping
}

type NewBaseStageOptions

type NewBaseStageOptions struct {
	ImageName        string
	ConfigMounts     []*config.Mount
	ImageTmpDir      string
	ContainerWerfDir string
	ProjectName      string
}

type NewGitArchiveStageOptions

type NewGitArchiveStageOptions struct {
	ArchivesDir          string
	ContainerArchivesDir string
}

type NewGitPatchStageOptions

type NewGitPatchStageOptions struct {
	PatchesDir           string
	ArchivesDir          string
	ContainerPatchesDir  string
	ContainerArchivesDir string
}

type SetupStage

type SetupStage struct {
	*UserWithGitPatchStage
}

func GenerateSetupStage

func GenerateSetupStage(imageBaseConfig *config.ImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *NewBaseStageOptions) *SetupStage

func (*SetupStage) GetDependencies

func (s *SetupStage) GetDependencies(_ Conveyor, _ image.ImageInterface) (string, error)

func (*SetupStage) PrepareImage

func (s *SetupStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

type StageName

type StageName string
const (
	From                 StageName = "from"
	BeforeInstall        StageName = "beforeInstall"
	ImportsBeforeInstall StageName = "importsBeforeInstall"
	GitArchive           StageName = "gitArchive"
	Install              StageName = "install"
	ImportsAfterInstall  StageName = "importsAfterInstall"
	BeforeSetup          StageName = "beforeSetup"
	ImportsBeforeSetup   StageName = "importsBeforeSetup"
	Setup                StageName = "setup"
	ImportsAfterSetup    StageName = "importsAfterSetup"
	GitCache             StageName = "gitCache"
	GitLatestPatch       StageName = "gitLatestPatch"
	DockerInstructions   StageName = "dockerInstructions"
)

type UserStage

type UserStage struct {
	*BaseStage
	// contains filtered or unexported fields
}

type UserWithGitPatchStage

type UserWithGitPatchStage struct {
	*UserStage
	GitPatchStage *GitPatchStage
}

func (*UserWithGitPatchStage) AfterImageSyncDockerStateHook

func (s *UserWithGitPatchStage) AfterImageSyncDockerStateHook(c Conveyor) error

func (*UserWithGitPatchStage) PrepareImage

func (s *UserWithGitPatchStage) PrepareImage(c Conveyor, prevBuiltImage, image image.ImageInterface) error

Jump to

Keyboard shortcuts

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