build

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 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 Builder

type Builder struct {
	Registry         string
	RegistryInsecure bool
	BuildTag         string
	Logger           Logger
	Interface        Interface
	DoPush           bool
}

Builder uses buildkit to build a list of service directories

func (*Builder) BuildService

func (builder *Builder) BuildService(ctx context.Context, service util.BuildableService) error

BuildService builds a specific sevice directory with a specific context

type Interface

type Interface interface {
	//StartJob notifies the interface that a job has been received, and ready to start
	StartJob(service string, image string)
	//FailJob marks a specific job as having failed with a given error.
	//This job is "dead" and will no longer receive any logs.
	FailJob(service string, err error)
	//SucceedJob marks a specific job as having succeeded. It will no longer receive any logs.
	SucceedJob(service string)
	//SetPushing marks a job as currently pushing
	SetPushing(service string)
	//ProcessLog handles a single log line
	ProcessLog(service string, logLine string)
	//Terminate this interface and close any resources it is using.
	Close()
	//The interface is in charge of handling user cancelling (e.g., sigquit or ^C).
	//Call these functions when the user specifies that they would like to cancel building.
	AddCancelListener(cancelFunc func())
}

An Interface represents a way to output the current state of a build

Currently there are two implementations:
- Interactive Interfaces use advanced terminal capabilities, similar to the "curses" library
- Plaintext Interfaces simply output jobs and their output as they are built

func NewInteractiveInterface

func NewInteractiveInterface() (Interface, error)

NewInteractiveInterface creates and initializes a new tcell screen and event loop for use as an Interface

func NewPlaintextInterface

func NewPlaintextInterface() Interface

NewPlaintextInterface initializes a new plaintext (e.g., no advanced terminal required) Interface

type Logger

type Logger interface {
	Log(service string, when time.Time, message ...interface{}) error
	Close()
	AddLogLineListener(func(service, logLine string))
}

Logger takes log messages from the buildkit build server(s) and stores them

func NewFlatfileLogger

func NewFlatfileLogger(logDirectory string, verbose bool) Logger

NewFlatfileLogger builds a new Logger which writes text logs to (repository root)/logs/(service name).log

Jump to

Keyboard shortcuts

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