stage

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidBaseImage = errors.New("invalid base image")

Functions

func CmdOrEntrypointStringToSlice

func CmdOrEntrypointStringToSlice(cmdOrEntrypoint string) ([]string, error)

func GetDependenciesArgsKeys

func GetDependenciesArgsKeys(dependencies []*config.Dependency) (res []string)

func GetLegacyCompatibleStageName

func GetLegacyCompatibleStageName(name StageName) string

TODO(compatibility): remove in v1.3

func IsErrInvalidBaseImage

func IsErrInvalidBaseImage(err error) bool

func ResolveDependenciesArgs

func ResolveDependenciesArgs(targetPlatform string, dependencies []*config.Dependency, c Conveyor) map[string]string

Types

type BaseStage

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

func NewBaseStage

func NewBaseStage(name StageName, options *BaseStageOptions) *BaseStage

func (*BaseStage) ExpandDependencies

func (s *BaseStage) ExpandDependencies(ctx context.Context, c Conveyor, baseEnv map[string]string) error

func (*BaseStage) GetContentDigest

func (s *BaseStage) GetContentDigest() string

func (*BaseStage) GetDependencies

func (s *BaseStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*BaseStage) GetDigest

func (s *BaseStage) GetDigest() string

func (*BaseStage) GetGitMappings

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

func (*BaseStage) GetNextStageDependencies

func (s *BaseStage) GetNextStageDependencies(_ context.Context, _ Conveyor) (string, error)

func (*BaseStage) GetStageImage

func (s *BaseStage) GetStageImage() *StageImage

func (*BaseStage) HasPrevStage

func (s *BaseStage) HasPrevStage() bool

func (*BaseStage) ImageName

func (s *BaseStage) ImageName() string

func (*BaseStage) IsEmpty

func (s *BaseStage) IsEmpty(_ context.Context, _ Conveyor, _ *StageImage) (bool, error)

func (*BaseStage) IsStapelStage

func (s *BaseStage) IsStapelStage() bool

func (*BaseStage) LogDetailedName

func (s *BaseStage) LogDetailedName() string

func (*BaseStage) LogName

func (s *BaseStage) LogName() string

func (*BaseStage) Name

func (s *BaseStage) Name() StageName

func (*BaseStage) PreRun

func (s *BaseStage) PreRun(_ context.Context, _ Conveyor) error

func (*BaseStage) PrepareImage

func (s *BaseStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

func (*BaseStage) SelectSuitableStage

func (s *BaseStage) SelectSuitableStage(_ context.Context, c Conveyor, stages []*imagePkg.StageDescription) (*imagePkg.StageDescription, error)

func (*BaseStage) SetContentDigest

func (s *BaseStage) SetContentDigest(contentDigest string)

func (*BaseStage) SetDigest

func (s *BaseStage) SetDigest(digest string)

func (*BaseStage) SetGitMappings

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

func (*BaseStage) SetStageImage

func (s *BaseStage) SetStageImage(stageImage *StageImage)

func (*BaseStage) TargetPlatform

func (s *BaseStage) TargetPlatform() string

func (*BaseStage) UsesBuildContext

func (s *BaseStage) UsesBuildContext() bool

type BaseStageOptions

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

type BeforeInstallStage

type BeforeInstallStage struct {
	*UserStage
}

func GenerateBeforeInstallStage

func GenerateBeforeInstallStage(ctx context.Context, imageBaseConfig *config.StapelImageBase, baseStageOptions *BaseStageOptions) *BeforeInstallStage

func (*BeforeInstallStage) GetDependencies

func (s *BeforeInstallStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*BeforeInstallStage) PrepareImage

func (s *BeforeInstallStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type BeforeSetupStage

type BeforeSetupStage struct {
	*UserWithGitPatchStage
}

func GenerateBeforeSetupStage

func GenerateBeforeSetupStage(ctx context.Context, imageBaseConfig *config.StapelImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *BaseStageOptions) *BeforeSetupStage

func (*BeforeSetupStage) GetDependencies

func (s *BeforeSetupStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*BeforeSetupStage) PrepareImage

func (s *BeforeSetupStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type ContainerBackendStub

type ContainerBackendStub struct {
	container_backend.ContainerBackend
	// contains filtered or unexported fields
}

func NewContainerBackendStub

func NewContainerBackendStub() *ContainerBackendStub

func (*ContainerBackendStub) GetImageInfo

func (containerBackend *ContainerBackendStub) GetImageInfo(ctx context.Context, ref string, opts container_backend.GetImageInfoOpts) (*image.Info, error)

func (*ContainerBackendStub) HasContainerRootMountSupport

func (containerBackend *ContainerBackendStub) HasContainerRootMountSupport() bool

func (*ContainerBackendStub) Pull

func (containerBackend *ContainerBackendStub) Pull(ctx context.Context, ref string, opts container_backend.PullOpts) 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 ContextChecksum

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

func NewContextChecksum

func NewContextChecksum(dockerignorePathMatcher path_matcher.PathMatcher) *ContextChecksum

type Conveyor

type Conveyor interface {
	GetImportMetadata(ctx context.Context, projectName, id string) (*storage.ImportMetadata, error)
	PutImportMetadata(ctx context.Context, projectName string, metadata *storage.ImportMetadata) error
	RmImportMetadata(ctx context.Context, projectName, id string) error

	GetImageStageContentDigest(targetPlatform, imageName, stageName string) string
	GetImageContentDigest(targetPlatform, imageName string) string

	FetchImageStage(ctx context.Context, targetPlatform, imageName, stageName string) error
	FetchLastNonEmptyImageStage(ctx context.Context, targetPlatform, imageName string) error
	GetImageNameForLastImageStage(targetPlatform, imageName string) string
	GetImageIDForLastImageStage(targetPlatform, imageName string) string
	GetImageDigestForLastImageStage(targetPlatform, imageName string) string

	GetImageNameForImageStage(targetPlatform, imageName, stageName string) string
	GetImageIDForImageStage(targetPlatform, imageName, stageName string) string

	GetImportServer(ctx context.Context, targetPlatform, imageName, stageName string) (import_server.ImportServer, error)
	GetLocalGitRepoVirtualMergeOptions() VirtualMergeOptions

	GiterminismManager() giterminism_manager.Interface

	UseLegacyStapelBuilder(cb container_backend.ContainerBackend) bool
}

type ConveyorStub

type ConveyorStub struct {
	Conveyor
	// contains filtered or unexported fields
}

func NewConveyorStub

func NewConveyorStub(giterminismManager *GiterminismManagerStub, lastStageImageNameByImageName, lastStageImageIDByImageName, lastStageImageDigestByImageName map[string]string) *ConveyorStub

func (*ConveyorStub) GetImageDigestForLastImageStage

func (c *ConveyorStub) GetImageDigestForLastImageStage(targetPlatform, imageName string) string

func (*ConveyorStub) GetImageIDForLastImageStage

func (c *ConveyorStub) GetImageIDForLastImageStage(targetPlatform, imageName string) string

func (*ConveyorStub) GetImageNameForLastImageStage

func (c *ConveyorStub) GetImageNameForLastImageStage(targetPlatform, imageName string) string

func (*ConveyorStub) GiterminismManager

func (c *ConveyorStub) GiterminismManager() giterminism_manager.Interface

func (*ConveyorStub) UseLegacyStapelBuilder

func (c *ConveyorStub) UseLegacyStapelBuilder(cr container_backend.ContainerBackend) bool

type DependenciesAfterInstallStage

type DependenciesAfterInstallStage struct {
	*DependenciesStage
}

func GenerateDependenciesAfterInstallStage

func GenerateDependenciesAfterInstallStage(imageBaseConfig *config.StapelImageBase, baseStageOptions *BaseStageOptions) *DependenciesAfterInstallStage

type DependenciesAfterSetupStage

type DependenciesAfterSetupStage struct {
	*DependenciesStage
}

func GenerateDependenciesAfterSetupStage

func GenerateDependenciesAfterSetupStage(imageBaseConfig *config.StapelImageBase, baseStageOptions *BaseStageOptions) *DependenciesAfterSetupStage

type DependenciesBeforeInstallStage

type DependenciesBeforeInstallStage struct {
	*DependenciesStage
}

func GenerateDependenciesBeforeInstallStage

func GenerateDependenciesBeforeInstallStage(imageBaseConfig *config.StapelImageBase, baseStageOptions *BaseStageOptions) *DependenciesBeforeInstallStage

type DependenciesBeforeSetupStage

type DependenciesBeforeSetupStage struct {
	*DependenciesStage
}

func GenerateDependenciesBeforeSetupStage

func GenerateDependenciesBeforeSetupStage(imageBaseConfig *config.StapelImageBase, baseStageOptions *BaseStageOptions) *DependenciesBeforeSetupStage

type DependenciesStage

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

func (*DependenciesStage) GetDependencies

func (s *DependenciesStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*DependenciesStage) PrepareImage

func (s *DependenciesStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type DockerRegistryApiStub

type DockerRegistryApiStub struct {
	docker_registry.GenericApiInterface
}

func NewDockerRegistryApiStub

func NewDockerRegistryApiStub() *DockerRegistryApiStub

func (*DockerRegistryApiStub) GetRepoImageConfigFile

func (dockerRegistry *DockerRegistryApiStub) GetRepoImageConfigFile(ctx context.Context, reference string) (*v1.ConfigFile, error)

type DockerRunArgs

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

func NewDockerRunArgs

func NewDockerRunArgs(dockerfile []byte, dockerfilePath, target, context string, contextAddFiles []string, buildArgs map[string]interface{}, addHost []string, network, ssh string) *DockerRunArgs

type DockerStages

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

func NewDockerStages

func NewDockerStages(dockerStages []instructions.Stage, dockerBuildArgsHash map[string]string, dockerMetaArgs []instructions.ArgCommand, dockerTargetStageIndex int) *DockerStages

func (*DockerStages) AddDockerStageEnv

func (ds *DockerStages) AddDockerStageEnv(dockerStageID int, key, value string) (string, string, error)

func (*DockerStages) DockerStageArgsHash

func (ds *DockerStages) DockerStageArgsHash(dockerStageID int) map[string]string

func (*DockerStages) DockerStageEnvs

func (ds *DockerStages) DockerStageEnvs(dockerStageID int) map[string]string

func (*DockerStages) ShlexProcessWordWithMetaArgs

func (ds *DockerStages) ShlexProcessWordWithMetaArgs(value string, resolvedDockerMetaArgsHash map[string]string) (string, error)

func (*DockerStages) ShlexProcessWordWithStageArgsAndEnvs

func (ds *DockerStages) ShlexProcessWordWithStageArgsAndEnvs(dockerStageID int, value string) (string, error)

func (*DockerStages) ShlexProcessWordWithStageEnvs

func (ds *DockerStages) ShlexProcessWordWithStageEnvs(dockerStageID int, value string) (string, error)

type FromStage

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

func GenerateFromStage

func GenerateFromStage(imageBaseConfig *config.StapelImageBase, baseImageRepoId string, baseStageOptions *BaseStageOptions) *FromStage

func (*FromStage) GetDependencies

func (s *FromStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*FromStage) HasPrevStage

func (s *FromStage) HasPrevStage() bool

func (*FromStage) PrepareImage

func (s *FromStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type FullDockerfileStage

type FullDockerfileStage struct {
	*DockerRunArgs
	*DockerStages
	*ContextChecksum
	*BaseStage
	// contains filtered or unexported fields
}

func GenerateFullDockerfileStage

func GenerateFullDockerfileStage(dockerRunArgs *DockerRunArgs, dockerStages *DockerStages, contextChecksum *ContextChecksum, baseStageOptions *BaseStageOptions, dependencies []*config.Dependency) *FullDockerfileStage

func (*FullDockerfileStage) FetchDependencies

func (s *FullDockerfileStage) FetchDependencies(ctx context.Context, c Conveyor, containerBackend container_backend.ContainerBackend, dockerRegistry docker_registry.GenericApiInterface) error

func (*FullDockerfileStage) GetDependencies

func (s *FullDockerfileStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*FullDockerfileStage) HasPrevStage

func (s *FullDockerfileStage) HasPrevStage() bool

func (*FullDockerfileStage) IsStapelStage

func (s *FullDockerfileStage) IsStapelStage() bool

func (*FullDockerfileStage) PrepareImage

func (s *FullDockerfileStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

func (*FullDockerfileStage) SetupDockerImageBuilder

func (*FullDockerfileStage) UsesBuildContext

func (s *FullDockerfileStage) UsesBuildContext() bool

type GitArchiveStage

type GitArchiveStage struct {
	*GitStage

	ArchivesDir          string
	ScriptsDir           string
	ContainerArchivesDir string
	ContainerScriptsDir  string
}

func NewGitArchiveStage

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

func (*GitArchiveStage) GetDependencies

func (s *GitArchiveStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

TODO: 1.3 add git mapping type (dir, file, ...) to gitArchive stage digest

func (*GitArchiveStage) GetNextStageDependencies

func (s *GitArchiveStage) GetNextStageDependencies(ctx context.Context, c Conveyor) (string, error)

func (*GitArchiveStage) IsEmpty

func (s *GitArchiveStage) IsEmpty(ctx context.Context, c Conveyor, stageImage *StageImage) (bool, error)

func (*GitArchiveStage) PrepareImage

func (s *GitArchiveStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

func (*GitArchiveStage) SelectSuitableStage

func (s *GitArchiveStage) SelectSuitableStage(ctx context.Context, c Conveyor, stages []*image.StageDescription) (*image.StageDescription, error)

type GitCacheStage

type GitCacheStage struct {
	*GitPatchStage
}

func NewGitCacheStage

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

func (*GitCacheStage) GetDependencies

func (s *GitCacheStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*GitCacheStage) GetNextStageDependencies

func (s *GitCacheStage) GetNextStageDependencies(ctx context.Context, c Conveyor) (string, error)

func (*GitCacheStage) IsEmpty

func (s *GitCacheStage) IsEmpty(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (bool, error)

func (*GitCacheStage) SelectSuitableStage

func (s *GitCacheStage) SelectSuitableStage(ctx context.Context, c Conveyor, stages []*image.StageDescription) (*image.StageDescription, error)

type GitLatestPatchStage

type GitLatestPatchStage struct {
	*GitPatchStage
}

func NewGitLatestPatchStage

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

func (*GitLatestPatchStage) GetDependencies

func (s *GitLatestPatchStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*GitLatestPatchStage) GetNextStageDependencies

func (s *GitLatestPatchStage) GetNextStageDependencies(ctx context.Context, c Conveyor) (string, error)

func (*GitLatestPatchStage) IsEmpty

func (s *GitLatestPatchStage) IsEmpty(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (bool, error)

func (*GitLatestPatchStage) SelectSuitableStage

func (s *GitLatestPatchStage) SelectSuitableStage(ctx context.Context, c Conveyor, stages []*image.StageDescription) (*image.StageDescription, error)

type GitMapping

type GitMapping struct {
	Name               string
	As                 string
	Branch             string
	Tag                string
	Commit             string
	Add                string
	To                 string
	Owner              string
	Group              string
	IncludePaths       []string
	ExcludePaths       []string
	StagesDependencies map[StageName][]string

	ContainerPatchesDir  string
	ContainerArchivesDir string
	ScriptsDir           string
	ContainerScriptsDir  string

	BaseCommitByPrevBuiltImageName map[string]string
	// contains filtered or unexported fields
}

func NewGitMapping

func NewGitMapping() *GitMapping

func (*GitMapping) AddGitCommitToImageLabels

func (gm *GitMapping) AddGitCommitToImageLabels(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, stageImage *StageImage, commitInfo ImageCommitInfo)

func (*GitMapping) GetBaseCommitForPrevBuiltImage

func (gm *GitMapping) GetBaseCommitForPrevBuiltImage(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (string, error)

func (*GitMapping) GetBuiltImageCommitInfo

func (gm *GitMapping) GetBuiltImageCommitInfo(builtImageLabels map[string]string) (ImageCommitInfo, error)

func (*GitMapping) GetFullName

func (gm *GitMapping) GetFullName() string

func (*GitMapping) GetLatestCommitInfo

func (gm *GitMapping) GetLatestCommitInfo(ctx context.Context, c Conveyor) (ImageCommitInfo, error)

func (*GitMapping) GetParamshash

func (gm *GitMapping) GetParamshash() string

func (*GitMapping) GetPatchContent

func (gm *GitMapping) GetPatchContent(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (string, error)

func (*GitMapping) GitRepo

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

func (*GitMapping) ImageGitCommitLabel

func (gm *GitMapping) ImageGitCommitLabel() string

func (*GitMapping) IsLocal

func (gm *GitMapping) IsLocal() bool

func (*GitMapping) IsPatchEmpty

func (gm *GitMapping) IsPatchEmpty(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (bool, error)

func (*GitMapping) PatchSize

func (gm *GitMapping) PatchSize(ctx context.Context, c Conveyor, fromCommit string) (int64, error)

func (*GitMapping) PrepareArchiveForImage

func (gm *GitMapping) PrepareArchiveForImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, stageImage *StageImage) error

func (*GitMapping) PreparePatchForImage

func (gm *GitMapping) PreparePatchForImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage) error

func (*GitMapping) SetGitRepo

func (gm *GitMapping) SetGitRepo(gitRepo git_repo.GitRepo)

func (*GitMapping) StageDependenciesChecksum

func (gm *GitMapping) StageDependenciesChecksum(ctx context.Context, c Conveyor, stageName StageName) (string, error)

func (*GitMapping) VirtualMergeFromCommitLabel

func (gm *GitMapping) VirtualMergeFromCommitLabel() string

func (*GitMapping) VirtualMergeIntoCommitLabel

func (gm *GitMapping) VirtualMergeIntoCommitLabel() string

func (*GitMapping) VirtualMergeLabel

func (gm *GitMapping) VirtualMergeLabel() string

type GitPatchStage

type GitPatchStage struct {
	*GitStage

	ScriptsDir           string
	ContainerPatchesDir  string
	ContainerArchivesDir string
	ContainerScriptsDir  string
}

func (*GitPatchStage) IsEmpty

func (s *GitPatchStage) IsEmpty(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (bool, error)

func (*GitPatchStage) PrepareImage

func (s *GitPatchStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type GitRepoArchiveStub

type GitRepoArchiveStub struct {
	git_repo.Archive
}

func NewGitRepoArchiveStub

func NewGitRepoArchiveStub() *GitRepoArchiveStub

func (*GitRepoArchiveStub) GetFilePath

func (archive *GitRepoArchiveStub) GetFilePath() string

type GitStage

type GitStage struct {
	*BaseStage
}

func (*GitStage) IsEmpty

func (s *GitStage) IsEmpty(ctx context.Context, _ Conveyor, _ *StageImage) (bool, error)

func (*GitStage) PrepareImage

func (s *GitStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type GiterminismInspectorStub

type GiterminismInspectorStub struct {
	giterminism_manager.Inspector
}

func NewGiterminismInspectorStub

func NewGiterminismInspectorStub() *GiterminismInspectorStub

func (*GiterminismInspectorStub) InspectBuildContextFiles

func (inspector *GiterminismInspectorStub) InspectBuildContextFiles(ctx context.Context, matcher path_matcher.PathMatcher) error

type GiterminismManagerStub

type GiterminismManagerStub struct {
	giterminism_manager.Interface
	// contains filtered or unexported fields
}

func NewGiterminismManagerStub

func NewGiterminismManagerStub(localGitRepo git_repo.GitRepo, inspector giterminism_manager.Inspector) *GiterminismManagerStub

func (*GiterminismManagerStub) Dev

func (manager *GiterminismManagerStub) Dev() bool

func (*GiterminismManagerStub) HeadCommit

func (manager *GiterminismManagerStub) HeadCommit() string

func (*GiterminismManagerStub) Inspector

func (*GiterminismManagerStub) LocalGitRepo

func (manager *GiterminismManagerStub) LocalGitRepo() git_repo.GitRepo

func (*GiterminismManagerStub) RelativeToGitProjectDir

func (manager *GiterminismManagerStub) RelativeToGitProjectDir() string

type ImageCommitInfo

type ImageCommitInfo struct {
	Commit                 string
	VirtualMerge           bool
	VirtualMergeFromCommit string
	VirtualMergeIntoCommit string
}

type InstallStage

type InstallStage struct {
	*UserWithGitPatchStage
}

func GenerateInstallStage

func GenerateInstallStage(ctx context.Context, imageBaseConfig *config.StapelImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *BaseStageOptions) *InstallStage

func (*InstallStage) GetDependencies

func (s *InstallStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*InstallStage) PrepareImage

func (s *InstallStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type Interface

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

	IsEmpty(ctx context.Context, c Conveyor, prevBuiltImage *StageImage) (bool, error)

	ExpandDependencies(ctx context.Context, c Conveyor, baseEnv map[string]string) error
	FetchDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, dockerRegistry docker_registry.GenericApiInterface) error
	GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)
	GetNextStageDependencies(ctx context.Context, c Conveyor) (string, error)

	PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

	PreRun(context.Context, Conveyor) error

	SetDigest(digest string)
	GetDigest() string

	SetContentDigest(contentDigest string)
	GetContentDigest() string

	SetStageImage(*StageImage)
	GetStageImage() *StageImage

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

	SelectSuitableStage(_ context.Context, c Conveyor, stages []*image.StageDescription) (*image.StageDescription, error)

	HasPrevStage() bool
	IsStapelStage() bool

	UsesBuildContext() bool
}

type LegacyContainerOptionsStub

type LegacyContainerOptionsStub struct {
	container_backend.LegacyContainerOptions

	Env map[string]string
}

func NewLegacyContainerOptionsStub

func NewLegacyContainerOptionsStub() *LegacyContainerOptionsStub

func (*LegacyContainerOptionsStub) AddEnv

func (opts *LegacyContainerOptionsStub) AddEnv(envs map[string]string)

type LegacyContainerStub

type LegacyContainerStub struct {
	container_backend.LegacyContainer
	// contains filtered or unexported fields
}

func NewLegacyContainerStub

func NewLegacyContainerStub() *LegacyContainerStub

func (*LegacyContainerStub) ServiceCommitChangeOptions

func (c *LegacyContainerStub) ServiceCommitChangeOptions() container_backend.LegacyContainerOptions

type LegacyImageStub

type LegacyImageStub struct {
	container_backend.LegacyImageInterface
	// contains filtered or unexported fields
}

func NewLegacyImageStub

func NewLegacyImageStub() *LegacyImageStub

func (*LegacyImageStub) Container

type LocalGitRepoStub

type LocalGitRepoStub struct {
	git_repo.GitRepo
	// contains filtered or unexported fields
}

func NewLocalGitRepoStub

func NewLocalGitRepoStub(headCommitHash string) *LocalGitRepoStub

func (*LocalGitRepoStub) GetOrCreateArchive

func (repo *LocalGitRepoStub) GetOrCreateArchive(ctx context.Context, opts git_repo.ArchiveOptions) (git_repo.Archive, error)

func (*LocalGitRepoStub) GetOrCreateChecksum

func (repo *LocalGitRepoStub) GetOrCreateChecksum(ctx context.Context, opts git_repo.ChecksumOptions) (string, error)

func (*LocalGitRepoStub) HeadCommitHash

func (repo *LocalGitRepoStub) HeadCommitHash(ctx context.Context) (string, error)

type NewGitArchiveStageOptions

type NewGitArchiveStageOptions struct {
	ArchivesDir          string
	ScriptsDir           string
	ContainerArchivesDir string
	ContainerScriptsDir  string
}

type NewGitPatchStageOptions

type NewGitPatchStageOptions struct {
	ScriptsDir           string
	ContainerPatchesDir  string
	ContainerArchivesDir string
	ContainerScriptsDir  string
}

type SetupStage

type SetupStage struct {
	*UserWithGitPatchStage
}

func GenerateSetupStage

func GenerateSetupStage(ctx context.Context, imageBaseConfig *config.StapelImageBase, gitPatchStageOptions *NewGitPatchStageOptions, baseStageOptions *BaseStageOptions) *SetupStage

func (*SetupStage) GetDependencies

func (s *SetupStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*SetupStage) PrepareImage

func (s *SetupStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type StageName

type StageName string
const (
	From                      StageName = "from"
	BeforeInstall             StageName = "beforeInstall"
	DependenciesBeforeInstall StageName = "dependenciesBeforeInstall"
	GitArchive                StageName = "gitArchive"
	Install                   StageName = "install"
	DependenciesAfterInstall  StageName = "dependenciesAfterInstall"
	BeforeSetup               StageName = "beforeSetup"
	DependenciesBeforeSetup   StageName = "dependenciesBeforeSetup"
	Setup                     StageName = "setup"
	DependenciesAfterSetup    StageName = "dependenciesAfterSetup"
	GitCache                  StageName = "gitCache"
	GitLatestPatch            StageName = "gitLatestPatch"
	DockerInstructions        StageName = "dockerInstructions"

	Dockerfile StageName = "dockerfile"
)

type StapelDockerInstructionsStage

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

func GenerateStapelDockerInstructionsStage

func GenerateStapelDockerInstructionsStage(imageConfig *config.StapelImage, baseStageOptions *BaseStageOptions) *StapelDockerInstructionsStage

func (*StapelDockerInstructionsStage) GetDependencies

func (s *StapelDockerInstructionsStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error)

func (*StapelDockerInstructionsStage) PrepareImage

func (s *StapelDockerInstructionsStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

type UserStage

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

type UserWithGitPatchStage

type UserWithGitPatchStage struct {
	*UserStage
	GitPatchStage *GitPatchStage
}

func (*UserWithGitPatchStage) GetNextStageDependencies

func (s *UserWithGitPatchStage) GetNextStageDependencies(ctx context.Context, c Conveyor) (string, error)

func (*UserWithGitPatchStage) PrepareImage

func (s *UserWithGitPatchStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error

func (*UserWithGitPatchStage) SelectSuitableStage

func (s *UserWithGitPatchStage) SelectSuitableStage(ctx context.Context, c Conveyor, stages []*image.StageDescription) (*image.StageDescription, error)

type VirtualMergeOptions

type VirtualMergeOptions struct {
	VirtualMerge bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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