builder

package
v0.0.0-...-cf7397b Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDockerfileNotExist is returned when no Dockerfile exists during "duffle build."
	ErrDockerfileNotExist = errors.New("Dockerfile does not exist")
)
View Source
var SummaryStatusCodeName = map[int]string{
	0: "UNKNOWN",
	1: "LOGGING",
	2: "STARTED",
	3: "ONGOING",
	4: "SUCCESS",
	5: "FAILURE",
}

SummaryStatusCodeName is the relation between summary status code enums and their respective names.

Functions

This section is empty.

Types

type AppContext

type AppContext struct {
	Bldr *Builder
	Ctx  *Context
	Log  io.WriteCloser
	ID   string
}

AppContext contains state information carried across various duffle stage boundaries

type Builder

type Builder struct {
	ID      string
	LogsDir string
	// If this is true, versions will contain build metadata
	// Example:
	//   0.1.2+2c3c59e8a5adad62d2245cbb7b2a8685b1a9a717
	VersionWithBuildMetadata bool
	ImageBuilders            []imagebuilder.ImageBuilder
}

Builder defines how to interact with a bundle builder

func New

func New() *Builder

New returns a new Builder

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, app *AppContext) error

Build passes the context of each component to its respective builder

func (*Builder) Logs

func (b *Builder) Logs(appName string) string

Logs returns the path to the build logs.

Set after Up is called (otherwise "").

func (*Builder) PrepareBuild

func (b *Builder) PrepareBuild(bldr *Builder, mfst *manifest.Manifest, appDir string, imageBuilders []imagebuilder.ImageBuilder) (*AppContext, *bundle.Bundle, error)

PrepareBuild prepares a build

type Context

type Context struct {
	Manifest *manifest.Manifest
	AppDir   string
}

Context contains information about the application

type Summary

type Summary struct {
	// StageDesc describes the particular stage this summary
	// represents, e.g. "Build Docker Image." This is meant
	// to be a canonical summary of the stage's intent.
	StageDesc string `json:"stage_desc,omitempty"`
	// status_text indicates a string description of the progress
	// or completion of duffle build.
	StatusText string `json:"status_text,omitempty"`
	// status_code indicates the status of the progress or
	// completion of a duffle build.
	StatusCode SummaryStatusCode `json:"status_code,omitempty"`
	// build_id is the build identifier associated with this duffle build build.
	BuildID string `json:"build_id,omitempty"`
}

Summary is the message returned when executing a duffle build.

type SummaryStatusCode

type SummaryStatusCode int

SummaryStatusCode is the enumeration of the possible status codes returned for a duffle build.

const (
	// SummaryUnknown means that the status of `duffle build` is in an unknown state.
	SummaryUnknown SummaryStatusCode = iota
	// SummaryLogging means that the status is currently gathering and exporting logs.
	SummaryLogging
	// SummaryStarted means that `duffle build` has begun.
	SummaryStarted
	// SummaryOngoing means that `duffle build` is ongoing and we are waiting for further information from the builder.
	SummaryOngoing
	// SummarySuccess means that `duffle build` has succeeded.
	SummarySuccess
	// SummaryFailure means that `duffle build` has failed. Usually this can be followed build by checking the build logs.
	SummaryFailure
)

Jump to

Keyboard shortcuts

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