builder

package
v0.0.0-...-e6eacfd Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Build actionType = iota // Build is an image build
	Push                    // Push is a registry push
)

Docker action types

Variables

View Source
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

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

type RepoBuildData struct {
	DockerfilePath string
	Context        io.Reader
	Tags           []string //{name}:{tag}
}

RepoBuildData contains data about a GitHub repo necessary to do a Docker build

type S3ErrorLogConfig

type S3ErrorLogConfig struct {
	PushToS3          bool
	PresignTTLMinutes uint
	Region            string
	Bucket            string
}

Jump to

Keyboard shortcuts

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