build

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application is an application service to build docker images

func NewApplication

func NewApplication(options ...OptionsFunc) *Application

NewApplication creates a Service to build docker images

func (*Application) Build

func (a *Application) Build(ctx context.Context, buildPlan Planner, name string, version []string, options *Options, optionsFunc ...OptionsFunc) error

Build method carries out the application tasks

func (*Application) Options

func (a *Application) Options(opts ...OptionsFunc)

Options configure the service

type BuildCommandFactorier

type BuildCommandFactorier interface {
	New(repository.BuildDriverer, *image.Image, *image.BuildDriverOptions) command.BuildCommander
}

BuildCommandFactorier interface defines the factory of build commands

type Dispatcher

type Dispatcher interface {
	Enqueue(scheduler.Jobber)
}

Dispatcher is a dispatcher to build docker images

type DriverFactorier

type DriverFactorier interface {
	Get(id string) (driverfactory.BuildDriverFactoryFunc, error)
	Register(id string, driver driverfactory.BuildDriverFactoryFunc) error
}

DriverFactorier interface defines the factory to create a build driver

type JobFactorier

type JobFactorier interface {
	New(job.Commander) scheduler.Jobber
}

JobFactorier interface defines the factory of build jobs

type MockApplication

type MockApplication struct {
	mock.Mock
}

MockApplication is a mock of build application

func NewMockApplication

func NewMockApplication() *MockApplication

NewMockApplication return a mock of build application

func (*MockApplication) Build

func (m *MockApplication) Build(ctx context.Context, buildPlan Planner, name string, version []string, options *Options, optionsFunc ...OptionsFunc) error

Build provides a mock function with given fields: ctx, buildPlan, name, version, options, optionsFunc

type Options

type Options struct {
	// AnsibleConnectionLocal is the local connection to use on ansible driver
	AnsibleConnectionLocal bool
	// AnsibleIntermediateContainerName is the name of an intermediate container that can be used during ansible build process
	AnsibleIntermediateContainerName string
	// AnsibleInventoryPath is the path to the ansible inventory file ??
	AnsibleInventoryPath string
	// AnsibleLimit is the ansible limit ??
	AnsibleLimit string
	// EnableSemanticVersionTags is a flag to enable semantic version tags
	EnableSemanticVersionTags bool
	// ImageFromName is the parent's image name
	ImageFromName string `yaml:"image_from_name"`
	// ImageFromRegistryHost is the parent's image registry host
	ImageFromRegistryHost string `yaml:"image_from_registry_host"`
	// ImageFromRegistryNamespace is the parent's image namespace
	ImageFromRegistryNamespace string `yaml:"image_from_namespace"`
	// ImageFromVersion is the paren't image version
	ImageFromVersion string `yaml:"image_from_version"`
	// ImageName is the name of the image to build
	ImageName string
	// ImageRegistryHost is the registry's host of the image to be built
	ImageRegistryHost string `yaml:"image_registry_host"`
	// ImageRegistryNamespace is the namespace of the image to be built
	ImageRegistryNamespace string `yaml:"image_namespace"`
	// ImageVersions is a list of versions to build
	ImageVersions []string
	// Lables is a list of labels to add to the image
	Labels map[string]string
	// PersistentLabels is a persistent labels list to be sent to driver
	PersistentLabels map[string]string `yaml:"persistent_labels"`
	// PersistentVars is a persistent variables list to be sent to driver
	PersistentVars map[string]interface{} `yaml:"persistent_variables"`
	// PullParentImage flag indicate whether to pull the parent image before building
	PullParentImage bool `yaml:"pull_parent_image"`
	// PushImageAfterBuild flag indicate whether to push the image to the registry once it has been built
	PushImageAfterBuild bool `yaml:"push_image_after_build"`
	// RemoveImagesAfterPush flag indicate whether to remove the image after build
	RemoveImagesAfterPush bool
	// SemanticVersionTagsTemplate are the semantic version tags templates to generate automatically
	SemanticVersionTagsTemplates []string `yaml:"semantic_version_tags_template"`
	// Tags is a list of tags to generate
	Tags []string `yaml:"tags"`
	// Vars is a variables list to be sent to driver
	Vars map[string]interface{} `yaml:"variables"`
}

Options

func (*Options) Copy

func (o *Options) Copy() *Options

Copy returns a copy of the Options

type OptionsFunc

type OptionsFunc func(*Application)

OptionsFunc is a function used to configure the service

func WithBuilders

func WithBuilders(builders repository.BuildersStorer) OptionsFunc

WithBuilders sets the builders storer

func WithCommandFactory

func WithCommandFactory(commandFactory BuildCommandFactorier) OptionsFunc

WithCommandFactory sets the command factory

func WithCredentials

func WithCredentials(credentials repository.AuthFactorier) OptionsFunc

func WithDispatch

func WithDispatch(dispatch Dispatcher) OptionsFunc

WithDispatch sets the dispatcher

func WithDriverFactory

func WithDriverFactory(driverFactory DriverFactorier) OptionsFunc

WithDriverFactory sets the driver factory

func WithJobFactory

func WithJobFactory(jobFactory JobFactorier) OptionsFunc

WithJobFactory sets the job factory

func WithSemver

func WithSemver(semver Semverser) OptionsFunc

WithSemver sets the semver

type PlanSteper

type PlanSteper interface {
	Image() *image.Image
	Notify()
	Wait()
}

PlanSteper interface defines the step plan

type Planner

type Planner interface {
	Plan(name string, versions []string) ([]*plan.Step, error)
}

Planner interfaces defines the storage of images

type Semverser

type Semverser interface {
	GenerateSemverList(version []string, tmpls []string) ([]string, error)
}

Semverser

Jump to

Keyboard shortcuts

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