stage

package
v1.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GAArchiveResetCommitRegex = "(\\[dapp reset\\])|(\\[reset dapp\\])"

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactImportAfterInstallStage

type ArtifactImportAfterInstallStage struct {
	*ArtifactImportStage
}

func GenerateArtifactImportAfterInstallStage

func GenerateArtifactImportAfterInstallStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *ArtifactImportAfterInstallStage

type ArtifactImportAfterSetupStage

type ArtifactImportAfterSetupStage struct {
	*ArtifactImportStage
}

func GenerateArtifactImportAfterSetupStage

func GenerateArtifactImportAfterSetupStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *ArtifactImportAfterSetupStage

type ArtifactImportBeforeInstallStage

type ArtifactImportBeforeInstallStage struct {
	*ArtifactImportStage
}

func GenerateArtifactImportBeforeInstallStage

func GenerateArtifactImportBeforeInstallStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *ArtifactImportBeforeInstallStage

type ArtifactImportBeforeSetupStage

type ArtifactImportBeforeSetupStage struct {
	*ArtifactImportStage
}

func GenerateArtifactImportBeforeSetupStage

func GenerateArtifactImportBeforeSetupStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *ArtifactImportBeforeSetupStage

type ArtifactImportStage

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

func (*ArtifactImportStage) GetDependencies

func (s *ArtifactImportStage) GetDependencies(c Conveyor, _ image.Image) (string, error)

func (*ArtifactImportStage) PreRunHook

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

func (*ArtifactImportStage) PrepareImage

func (s *ArtifactImportStage) PrepareImage(c Conveyor, _, image image.Image) error

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, _ image.Image) (string, error)

func (*BaseStage) GetGitArtifacts

func (s *BaseStage) GetGitArtifacts() []*GitArtifact

func (*BaseStage) GetImage

func (s *BaseStage) GetImage() image.Image

func (*BaseStage) GetSignature

func (s *BaseStage) GetSignature() string

func (*BaseStage) IsEmpty

func (s *BaseStage) IsEmpty(_ Conveyor, _ image.Image) (bool, error)

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 image.Image) error

func (*BaseStage) SetGitArtifacts

func (s *BaseStage) SetGitArtifacts(gitArtifacts []*GitArtifact)

func (*BaseStage) SetImage

func (s *BaseStage) SetImage(image image.Image)

func (*BaseStage) SetSignature

func (s *BaseStage) SetSignature(signature string)

func (*BaseStage) ShouldBeReset

func (s *BaseStage) ShouldBeReset(_ image.Image) (bool, error)

type BeforeInstallStage

type BeforeInstallStage struct {
	*UserStage
}

func GenerateBeforeInstallStage

func GenerateBeforeInstallStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *BeforeInstallStage

func (*BeforeInstallStage) GetDependencies

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

func (*BeforeInstallStage) PrepareImage

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

type BeforeSetupStage

type BeforeSetupStage struct {
	*UserWithGAPatchStage
}

func GenerateBeforeSetupStage

func GenerateBeforeSetupStage(dimgBaseConfig *config.DimgBase, gaPatchStageOptions *NewGaPatchStageOptions, baseStageOptions *NewBaseStageOptions) *BeforeSetupStage

func (*BeforeSetupStage) GetDependencies

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

func (*BeforeSetupStage) PrepareImage

func (s *BeforeSetupStage) PrepareImage(c Conveyor, prevBuiltImage, image image.Image) 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 {
	GetDimgSignature(dimgName string) string
	GetDimgImageName(dimgName string) string
	SetBuildingGAStage(dimgName string, stageName StageName)
	GetBuildingGAStage(dimgName string) StageName
}

type DockerInstructionsStage

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

func GenerateDockerInstructionsStage

func GenerateDockerInstructionsStage(dimgConfig *config.Dimg, baseStageOptions *NewBaseStageOptions) *DockerInstructionsStage

func (*DockerInstructionsStage) GetDependencies

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

func (*DockerInstructionsStage) PrepareImage

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

type FromStage

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

func GenerateFromStage

func GenerateFromStage(dimgBaseConfig *config.DimgBase, baseStageOptions *NewBaseStageOptions) *FromStage

func (*FromStage) GetDependencies

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

func (*FromStage) PrepareImage

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

type GAArchiveStage

type GAArchiveStage struct {
	*GAStage

	ArchivesDir          string
	ContainerArchivesDir string
}

func NewGAArchiveStage

func NewGAArchiveStage(gaArchiveStageOptions *NewGAArchiveStageOptions, baseStageOptions *NewBaseStageOptions) *GAArchiveStage

func (*GAArchiveStage) GetDependencies

func (s *GAArchiveStage) GetDependencies(_ Conveyor, _ image.Image) (string, error)

func (*GAArchiveStage) PrepareImage

func (s *GAArchiveStage) PrepareImage(c Conveyor, prevBuiltImage, image image.Image) error

type GALatestPatchStage

type GALatestPatchStage struct {
	*GAPatchStage
}

func NewGALatestPatchStage

func NewGALatestPatchStage(gaPatchStageOptions *NewGaPatchStageOptions, baseStageOptions *NewBaseStageOptions) *GALatestPatchStage

func (*GALatestPatchStage) GetDependencies

func (s *GALatestPatchStage) GetDependencies(_ Conveyor, prevImage image.Image) (string, error)

func (*GALatestPatchStage) IsEmpty

func (s *GALatestPatchStage) IsEmpty(c Conveyor, prevBuiltImage image.Image) (bool, error)

type GAPatchStage

type GAPatchStage struct {
	*GAStage

	PatchesDir          string
	ContainerPatchesDir string
}

func (*GAPatchStage) IsEmpty

func (s *GAPatchStage) IsEmpty(c Conveyor, prevBuiltImage image.Image) (bool, error)

func (*GAPatchStage) PrepareImage

func (s *GAPatchStage) PrepareImage(c Conveyor, prevBuiltImage, image image.Image) error

type GAPostSetupPatchStage

type GAPostSetupPatchStage struct {
	*GAPatchStage
}

func NewGAPostSetupPatchStage

func NewGAPostSetupPatchStage(gaPatchStageOptions *NewGaPatchStageOptions, baseStageOptions *NewBaseStageOptions) *GAPostSetupPatchStage

func (*GAPostSetupPatchStage) GetDependencies

func (s *GAPostSetupPatchStage) GetDependencies(_ Conveyor, prevImage image.Image) (string, error)

type GAStage

type GAStage struct {
	*BaseStage
}

func (*GAStage) AfterImageSyncDockerStateHook

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

func (*GAStage) IsEmpty

func (s *GAStage) IsEmpty(_ Conveyor, prevBuiltImage image.Image) (bool, error)

func (*GAStage) PrepareImage

func (s *GAStage) PrepareImage(c Conveyor, prevBuiltImage, image image.Image) error

func (*GAStage) ShouldBeReset

func (s *GAStage) ShouldBeReset(builtImage image.Image) (bool, error)

type GitArtifact

type GitArtifact 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 (*GitArtifact) AddGACommitToImageLabels

func (ga *GitArtifact) AddGACommitToImageLabels(image image.Image, commit string)

func (*GitArtifact) ApplyArchiveCommand

func (ga *GitArtifact) ApplyArchiveCommand(image image.Image) error

func (*GitArtifact) ApplyPatchCommand

func (ga *GitArtifact) ApplyPatchCommand(prevBuiltImage, image image.Image) error

func (*GitArtifact) GetCommitsToPatch

func (ga *GitArtifact) GetCommitsToPatch(prevBuiltImage image.Image) (string, string, error)

func (*GitArtifact) GetFullName

func (ga *GitArtifact) GetFullName() string

func (*GitArtifact) GetGACommitFromImageLabels

func (ga *GitArtifact) GetGACommitFromImageLabels(builtImage image.Image) string

func (*GitArtifact) GetParamshash

func (ga *GitArtifact) GetParamshash() string

func (*GitArtifact) GitRepo

func (ga *GitArtifact) GitRepo() git_repo.GitRepo

func (*GitArtifact) ImageGACommitLabel

func (ga *GitArtifact) ImageGACommitLabel() string

func (*GitArtifact) IsEmpty

func (ga *GitArtifact) IsEmpty() (bool, error)

func (*GitArtifact) IsLocal

func (ga *GitArtifact) IsLocal() bool

func (*GitArtifact) IsPatchEmpty

func (ga *GitArtifact) IsPatchEmpty(prevBuiltImage image.Image) (bool, error)

func (*GitArtifact) LatestCommit

func (ga *GitArtifact) LatestCommit() (string, error)

func (*GitArtifact) PatchSize

func (ga *GitArtifact) PatchSize(fromCommit string) (int64, error)

func (*GitArtifact) StageDependenciesChecksum

func (ga *GitArtifact) StageDependenciesChecksum(stageName StageName) (string, error)

type InstallStage

type InstallStage struct {
	*UserWithGAPatchStage
}

func GenerateInstallStage

func GenerateInstallStage(dimgBaseConfig *config.DimgBase, gaPatchStageOptions *NewGaPatchStageOptions, baseStageOptions *NewBaseStageOptions) *InstallStage

func (*InstallStage) GetDependencies

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

func (*InstallStage) PrepareImage

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

type Interface

type Interface interface {
	Name() StageName

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

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

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

	AfterImageSyncDockerStateHook(Conveyor) error
	PreRunHook(Conveyor) error

	SetSignature(signature string)
	GetSignature() string

	SetImage(image.Image)
	GetImage() image.Image

	SetGitArtifacts([]*GitArtifact)
	GetGitArtifacts() []*GitArtifact
}

type NewBaseStageOptions

type NewBaseStageOptions struct {
	DimgName         string
	ConfigMounts     []*config.Mount
	DimgTmpDir       string
	ContainerDappDir string
	ProjectBuildDir  string
}

type NewGAArchiveStageOptions

type NewGAArchiveStageOptions struct {
	ArchivesDir          string
	ContainerArchivesDir string
}

type NewGaPatchStageOptions

type NewGaPatchStageOptions struct {
	PatchesDir          string
	ContainerPatchesDir string
}

type SetupStage

type SetupStage struct {
	*UserWithGAPatchStage
}

func GenerateSetupStage

func GenerateSetupStage(dimgBaseConfig *config.DimgBase, gaPatchStageOptions *NewGaPatchStageOptions, baseStageOptions *NewBaseStageOptions) *SetupStage

func (*SetupStage) GetDependencies

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

func (*SetupStage) PrepareImage

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

type StageName

type StageName string
const (
	From                        StageName = "from"
	BeforeInstall               StageName = "before_install"
	ArtifactImportBeforeInstall StageName = "before_install_artifact"
	GAArchive                   StageName = "g_a_archive"
	Install                     StageName = "install"
	ArtifactImportAfterInstall  StageName = "after_install_artifact"
	BeforeSetup                 StageName = "before_setup"
	ArtifactImportBeforeSetup   StageName = "before_setup_artifact"
	Setup                       StageName = "setup"
	ArtifactImportAfterSetup    StageName = "after_setup_artifact"
	GAPostSetupPatch            StageName = "g_a_post_setup_patch"
	GALatestPatch               StageName = "g_a_latest_patch"
	DockerInstructions          StageName = "docker_instructions"
)

type UserStage

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

type UserWithGAPatchStage

type UserWithGAPatchStage struct {
	*UserStage
	GAPatchStage *GAPatchStage
}

func (*UserWithGAPatchStage) AfterImageSyncDockerStateHook

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

func (*UserWithGAPatchStage) PrepareImage

func (s *UserWithGAPatchStage) PrepareImage(c Conveyor, prevBuiltImage, image image.Image) error

Jump to

Keyboard shortcuts

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