Documentation ¶
Index ¶
- Constants
- Variables
- type ImageBuildClient
- type ImageBuildPusher
- type ImageBuilder
- func (ib *ImageBuilder) Build(ctx context.Context, req *lib.BuildRequest, id gocql.UUID) (string, error)
- func (ib *ImageBuilder) CleanImage(ctx context.Context, imageid string) error
- func (ib *ImageBuilder) PushBuildToRegistry(ctx context.Context, req *lib.BuildRequest) error
- func (ib *ImageBuilder) PushBuildToS3(ctx context.Context, imageid string, req *lib.BuildRequest) error
- type RepoBuildData
- type S3ErrorLogConfig
Constants ¶
const ( Build actionType = iota // Build is an image build Push // Push is a registry push )
Docker action types
Variables ¶
var ErrBuildNotNecessary = fmt.Errorf("build not necessary: tags or object exist")
ErrBuildNotNecessary indicates that the build was skipped due to not being necessary
Functions ¶
This section is empty.
Types ¶
type ImageBuildClient ¶
type ImageBuildClient interface { ImageBuild(context.Context, io.Reader, dtypes.ImageBuildOptions) (dtypes.ImageBuildResponse, error) ImageInspectWithRaw(context.Context, string) (dtypes.ImageInspect, []byte, error) ImageRemove(context.Context, string, dtypes.ImageRemoveOptions) ([]dtypes.ImageDelete, error) ImagePush(context.Context, string, dtypes.ImagePushOptions) (io.ReadCloser, error) ImageSave(context.Context, []string) (io.ReadCloser, error) ImageList(context.Context, dtypes.ImageListOptions) ([]dtypes.Image, error) }
ImageBuildClient describes a client that can manipulate images Add whatever Docker API methods we care about here
type ImageBuildPusher ¶
type ImageBuildPusher interface { Build(context.Context, *lib.BuildRequest, gocql.UUID) (string, error) CleanImage(context.Context, string) error PushBuildToRegistry(context.Context, *lib.BuildRequest) error PushBuildToS3(context.Context, string, *lib.BuildRequest) error }
ImageBuildPusher describes an object that can build and push container images
type ImageBuilder ¶
type ImageBuilder struct {
// contains filtered or unexported fields
}
ImageBuilder is an object that builds and pushes images
func NewImageBuilder ¶
func NewImageBuilder(eventbus kafka.EventBusProducer, datalayer datalayer.DataLayer, gf githubfetch.CodeFetcher, dc ImageBuildClient, mc metrics.MetricsCollector, osm s3.ObjectStorageManager, is squasher.ImageSquasher, itc tagcheck.ImageTagChecker, dcfg map[string]dtypes.AuthConfig, s3errorcfg S3ErrorLogConfig, logger *log.Logger) (*ImageBuilder, error)
NewImageBuilder returns a new ImageBuilder
func (*ImageBuilder) Build ¶
func (ib *ImageBuilder) Build(ctx context.Context, req *lib.BuildRequest, id gocql.UUID) (string, error)
Build builds an image accourding to the request
func (*ImageBuilder) CleanImage ¶
func (ib *ImageBuilder) CleanImage(ctx context.Context, imageid string) error
CleanImage cleans up the built image after it's been pushed
func (*ImageBuilder) PushBuildToRegistry ¶
func (ib *ImageBuilder) PushBuildToRegistry(ctx context.Context, req *lib.BuildRequest) error
PushBuildToRegistry pushes the already built image and all associated tags to the configured remote Docker registry. Caller must ensure the image has already been built successfully
func (*ImageBuilder) PushBuildToS3 ¶
func (ib *ImageBuilder) PushBuildToS3(ctx context.Context, imageid string, req *lib.BuildRequest) error
PushBuildToS3 exports and uploads the already built image to the configured S3 bucket/key
type RepoBuildData ¶
RepoBuildData contains data about a GitHub repo necessary to do a Docker build