builder

package
v1.105.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package builder is a generated GoMock package.

Package builder is a generated GoMock package.

Index

Constants

View Source
const (
	// CNBBuilderImage represents the local cnb builder.
	CNBBuilderImage_Heroku18 = "digitaloceanapps/cnb-local-builder:heroku-18_v0.65.0"
	CNBBuilderImage_Heroku22 = "digitaloceanapps/cnb-local-builder:heroku-22_v0.65.0"
)
View Source
const StaticSiteNginxImage = "nginx:alpine"

StaticSiteNginxImage is the nginx image used for static site container images.

Variables

View Source
var ErrNotFound = fmt.Errorf("image not found")

Functions

func GetImage

func GetImage(ctx context.Context, cli DockerEngineClient, ref string) (*types.ImageSummary, error)

func ImageExists

func ImageExists(ctx context.Context, cli DockerEngineClient, ref string) (bool, error)

func IsCNBBuild

func IsCNBBuild(spec godo.AppBuildableComponentSpec) bool

IsCNBBuild indicates whether the component will be built using the CNB builder.

func IsDockerBuild added in v1.82.1

func IsDockerBuild(spec godo.AppBuildableComponentSpec) bool

IsDockerBuild indicates whether the component will be built using the Docker builder.

Types

type Buildpack

type Buildpack struct {
	ID      string `json:"id,omitempty"`
	Version string `json:"version,omitempty"`
}

Buildpack represents a CNB buildpack.

type CNBComponentBuilder

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

CNBComponentBuilder represents a CNB builder.

func (CNBComponentBuilder) AppImageOutputName

func (b CNBComponentBuilder) AppImageOutputName() string

func (*CNBComponentBuilder) Build

Build attempts to build the requested component using the CNB Builder and tags the resulting container images.

func (CNBComponentBuilder) StaticSiteImageOutputName

func (b CNBComponentBuilder) StaticSiteImageOutputName() string

type CNBVersioning

type CNBVersioning struct {
	Buildpacks []*Buildpack
}

CNBVersioning contains CNB versioning config.

type ComponentBuilder

type ComponentBuilder interface {
	Build(context.Context) (ComponentBuilderResult, error)
}

ComponentBuilder is the interface of building one or more components.

type ComponentBuilderFactory

type ComponentBuilderFactory interface {
	NewComponentBuilder(DockerEngineClient, string, *godo.AppSpec, NewBuilderOpts) (ComponentBuilder, error)
}

ComponentBuilderFactory is the interface for creating a component builder.

type ComponentBuilderResult

type ComponentBuilderResult struct {
	Image         string
	BuildDuration time.Duration
	ExitCode      int
}

ComponentBuilderResult ...

type ContainerExecError

type ContainerExecError struct {
	Err      error
	ExitCode int
}

ContainerExecError contains additional data on a container exec error.

func (ContainerExecError) Error

func (e ContainerExecError) Error() string

Error returns the underlying error.

type DefaultComponentBuilderFactory

type DefaultComponentBuilderFactory struct{}

DefaultComponentBuilderFactory is the standard component builder factory.

func (*DefaultComponentBuilderFactory) NewComponentBuilder

func (f *DefaultComponentBuilderFactory) NewComponentBuilder(cli DockerEngineClient, contextDir string, spec *godo.AppSpec, opts NewBuilderOpts) (ComponentBuilder, error)

NewComponentBuilder returns the correct builder type depending upon the provided app and component.

type DockerComponentBuilder

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

DockerComponentBuilder builds components using a Dockerfile.

func (DockerComponentBuilder) AppImageOutputName

func (b DockerComponentBuilder) AppImageOutputName() string

func (*DockerComponentBuilder) Build

Build executes the component build and tags the resulting container images.

func (DockerComponentBuilder) StaticSiteImageOutputName

func (b DockerComponentBuilder) StaticSiteImageOutputName() string

type DockerEngineClient

type DockerEngineClient interface {
	ContainerCreate(ctx context.Context, config *containertypes.Config, hostConfig *containertypes.HostConfig, networkingConfig *networktypes.NetworkingConfig, platform *specs.Platform, containerName string) (containertypes.CreateResponse, error)
	ContainerStart(ctx context.Context, containerName string, options types.ContainerStartOptions) error
	ContainerLogs(ctx context.Context, containerName string, options types.ContainerLogsOptions) (io.ReadCloser, error)
	ContainerWait(ctx context.Context, containerName string, condition containertypes.WaitCondition) (<-chan containertypes.WaitResponse, <-chan error)
	ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error
	ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
	ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
	ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error
	ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
	CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error
	ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
	ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
	ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
}

DockerEngineClient ...

type MockComponentBuilder

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

MockComponentBuilder is a mock of ComponentBuilder interface.

func NewMockComponentBuilder

func NewMockComponentBuilder(ctrl *gomock.Controller) *MockComponentBuilder

NewMockComponentBuilder creates a new mock instance.

func (*MockComponentBuilder) Build

Build mocks base method.

func (*MockComponentBuilder) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockComponentBuilderFactory

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

MockComponentBuilderFactory is a mock of ComponentBuilderFactory interface.

func NewMockComponentBuilderFactory

func NewMockComponentBuilderFactory(ctrl *gomock.Controller) *MockComponentBuilderFactory

NewMockComponentBuilderFactory creates a new mock instance.

func (*MockComponentBuilderFactory) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockComponentBuilderFactory) NewComponentBuilder

func (m *MockComponentBuilderFactory) NewComponentBuilder(arg0 DockerEngineClient, arg1 string, arg2 *godo.AppSpec, arg3 NewBuilderOpts) (ComponentBuilder, error)

NewComponentBuilder mocks base method.

type MockComponentBuilderFactoryMockRecorder

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

MockComponentBuilderFactoryMockRecorder is the mock recorder for MockComponentBuilderFactory.

func (*MockComponentBuilderFactoryMockRecorder) NewComponentBuilder

func (mr *MockComponentBuilderFactoryMockRecorder) NewComponentBuilder(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

NewComponentBuilder indicates an expected call of NewComponentBuilder.

type MockComponentBuilderMockRecorder

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

MockComponentBuilderMockRecorder is the mock recorder for MockComponentBuilder.

func (*MockComponentBuilderMockRecorder) Build

func (mr *MockComponentBuilderMockRecorder) Build(arg0 interface{}) *gomock.Call

Build indicates an expected call of Build.

type MockDockerEngineClient

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

MockDockerEngineClient is a mock of DockerEngineClient interface.

func NewMockDockerEngineClient

func NewMockDockerEngineClient(ctrl *gomock.Controller) *MockDockerEngineClient

NewMockDockerEngineClient creates a new mock instance.

func (*MockDockerEngineClient) ContainerCreate

func (m *MockDockerEngineClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.CreateResponse, error)

ContainerCreate mocks base method.

func (*MockDockerEngineClient) ContainerExecAttach

func (m *MockDockerEngineClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)

ContainerExecAttach mocks base method.

func (*MockDockerEngineClient) ContainerExecCreate

func (m *MockDockerEngineClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)

ContainerExecCreate mocks base method.

func (*MockDockerEngineClient) ContainerExecInspect

func (m *MockDockerEngineClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)

ContainerExecInspect mocks base method.

func (*MockDockerEngineClient) ContainerExecStart

func (m *MockDockerEngineClient) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error

ContainerExecStart mocks base method.

func (*MockDockerEngineClient) ContainerLogs

func (m *MockDockerEngineClient) ContainerLogs(ctx context.Context, containerName string, options types.ContainerLogsOptions) (io.ReadCloser, error)

ContainerLogs mocks base method.

func (*MockDockerEngineClient) ContainerRemove

func (m *MockDockerEngineClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error

ContainerRemove mocks base method.

func (*MockDockerEngineClient) ContainerStart

func (m *MockDockerEngineClient) ContainerStart(ctx context.Context, containerName string, options types.ContainerStartOptions) error

ContainerStart mocks base method.

func (*MockDockerEngineClient) ContainerWait

func (m *MockDockerEngineClient) ContainerWait(ctx context.Context, containerName string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)

ContainerWait mocks base method.

func (*MockDockerEngineClient) CopyToContainer

func (m *MockDockerEngineClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error

CopyToContainer mocks base method.

func (*MockDockerEngineClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDockerEngineClient) ImageBuild

ImageBuild mocks base method.

func (*MockDockerEngineClient) ImageList

ImageList mocks base method.

func (*MockDockerEngineClient) ImagePull

func (m *MockDockerEngineClient) ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)

ImagePull mocks base method.

type MockDockerEngineClientMockRecorder

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

MockDockerEngineClientMockRecorder is the mock recorder for MockDockerEngineClient.

func (*MockDockerEngineClientMockRecorder) ContainerCreate

func (mr *MockDockerEngineClientMockRecorder) ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, containerName interface{}) *gomock.Call

ContainerCreate indicates an expected call of ContainerCreate.

func (*MockDockerEngineClientMockRecorder) ContainerExecAttach

func (mr *MockDockerEngineClientMockRecorder) ContainerExecAttach(ctx, execID, config interface{}) *gomock.Call

ContainerExecAttach indicates an expected call of ContainerExecAttach.

func (*MockDockerEngineClientMockRecorder) ContainerExecCreate

func (mr *MockDockerEngineClientMockRecorder) ContainerExecCreate(ctx, container, config interface{}) *gomock.Call

ContainerExecCreate indicates an expected call of ContainerExecCreate.

func (*MockDockerEngineClientMockRecorder) ContainerExecInspect

func (mr *MockDockerEngineClientMockRecorder) ContainerExecInspect(ctx, execID interface{}) *gomock.Call

ContainerExecInspect indicates an expected call of ContainerExecInspect.

func (*MockDockerEngineClientMockRecorder) ContainerExecStart

func (mr *MockDockerEngineClientMockRecorder) ContainerExecStart(ctx, execID, config interface{}) *gomock.Call

ContainerExecStart indicates an expected call of ContainerExecStart.

func (*MockDockerEngineClientMockRecorder) ContainerLogs

func (mr *MockDockerEngineClientMockRecorder) ContainerLogs(ctx, containerName, options interface{}) *gomock.Call

ContainerLogs indicates an expected call of ContainerLogs.

func (*MockDockerEngineClientMockRecorder) ContainerRemove

func (mr *MockDockerEngineClientMockRecorder) ContainerRemove(ctx, container, options interface{}) *gomock.Call

ContainerRemove indicates an expected call of ContainerRemove.

func (*MockDockerEngineClientMockRecorder) ContainerStart

func (mr *MockDockerEngineClientMockRecorder) ContainerStart(ctx, containerName, options interface{}) *gomock.Call

ContainerStart indicates an expected call of ContainerStart.

func (*MockDockerEngineClientMockRecorder) ContainerWait

func (mr *MockDockerEngineClientMockRecorder) ContainerWait(ctx, containerName, condition interface{}) *gomock.Call

ContainerWait indicates an expected call of ContainerWait.

func (*MockDockerEngineClientMockRecorder) CopyToContainer

func (mr *MockDockerEngineClientMockRecorder) CopyToContainer(ctx, container, path, content, options interface{}) *gomock.Call

CopyToContainer indicates an expected call of CopyToContainer.

func (*MockDockerEngineClientMockRecorder) ImageBuild

func (mr *MockDockerEngineClientMockRecorder) ImageBuild(ctx, context, options interface{}) *gomock.Call

ImageBuild indicates an expected call of ImageBuild.

func (*MockDockerEngineClientMockRecorder) ImageList

func (mr *MockDockerEngineClientMockRecorder) ImageList(ctx, options interface{}) *gomock.Call

ImageList indicates an expected call of ImageList.

func (*MockDockerEngineClientMockRecorder) ImagePull

func (mr *MockDockerEngineClientMockRecorder) ImagePull(ctx, refStr, options interface{}) *gomock.Call

ImagePull indicates an expected call of ImagePull.

type NewBuilderOpts

type NewBuilderOpts struct {
	Component               string
	Registry                string
	EnvOverride             map[string]string
	BuildCommandOverride    string
	CNBBuilderImageOverride string
	LogWriter               io.Writer
	Versioning              Versioning
	LocalCacheDir           string
	NoCache                 bool
}

NewBuilderOpts ...

type Versioning

type Versioning struct {
	CNB *godo.AppBuildConfigCNBVersioning
}

Versioning contains build versioning configuration.

Jump to

Keyboard shortcuts

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