build

package
v3.0.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidAssembler

func IsValidAssembler(c string) (valid bool, err error)

IsValidAssembler returns whether or not the given Assembler is valid

func IsValidURI

func IsValidURI(source string) (valid bool, err error)

IsValidURI returns whether or not the given source is valid

func MakeDef

func MakeDef(spec string) (types.Definition, error)

MakeDef gets a definition object from a spec

Types

type Assembler

type Assembler interface {
	Assemble(*types.Bundle, string) error
}

Assembler is responsible for assembling an image from a bundle. For example a bundle may be holding multiple file systems indended to be separate partitions within a SIF image. The assembler would need to detect these directories and make sure it properly assembles the SIF with them as partitions

type Build

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

Build is an abstracted way to look at the entire build process. For example calling NewBuild() will return this object. From there we can call Full() on this build object, which will:

Call Bundle() to obtain all data needed to execute the specified build locally on the machine
Execute all of a definition using AllSections()
And finally call Assemble() to create our container image

func NewBuild

func NewBuild(spec, dest, format string) (*Build, error)

NewBuild creates a new Build struct from a spec (URI, definition file, etc...)

func NewBuildJSON

func NewBuildJSON(r io.Reader, dest, format string) (*Build, error)

NewBuildJSON creates a new build struct from a JSON byte slice

func (*Build) AllSections

func (b *Build) AllSections() error

AllSections runs all the sections in the definition

func (*Build) Assemble

func (b *Build) Assemble(path string) error

Assemble assembles the bundle to the specified path

func (*Build) Bundle

func (b *Build) Bundle() (*types.Bundle, error)

Bundle creates the bundle using the ConveyorPacker and returns it. If this function is called multiple times it will return the already created Bundle

func (*Build) Full

func (b *Build) Full() error

Full runs a standard build from start to finish

func (*Build) Sections

func (b *Build) Sections(s []string) error

Sections runs the list of sections specified by name in s

func (*Build) WithSections

func (b *Build) WithSections(sections []string) error

WithSections runs a build but only runs the specified sections

func (*Build) WithoutSections

func (b *Build) WithoutSections() error

WithoutSections runs the build without running any section

type Conveyor

type Conveyor interface {
	Get(types.Definition) error
}

Conveyor is responsible for downloading from remote sources (library, shub, docker...)

type ConveyorPacker

type ConveyorPacker interface {
	Conveyor
	Packer
}

ConveyorPacker describes an interface that a ConveyorPacker type must implement

type Packer

type Packer interface {
	Pack() (*types.Bundle, error)
}

Packer is the type which is responsible for installing the chroot directory, metadata directory, and potentially other files/directories within the Bundle

type RemoteBuilder

type RemoteBuilder struct {
	Client     http.Client
	ImagePath  string
	Force      bool
	LibraryURL string
	Definition types.Definition
	IsDetached bool
	BuilderURL *url.URL
	AuthToken  string
}

RemoteBuilder contains the build request and response

func NewRemoteBuilder

func NewRemoteBuilder(imagePath, libraryURL string, d types.Definition, isDetached bool, builderAddr, authToken string) (rb *RemoteBuilder, err error)

NewRemoteBuilder creates a RemoteBuilder with the specified details.

func (*RemoteBuilder) Build

func (rb *RemoteBuilder) Build(ctx context.Context) (err error)

Build is responsible for making the request via the REST API to the remote builder

type RequestData

type RequestData struct {
	types.Definition `json:"definition"`
	LibraryRef       string `json:"libraryRef"`
	LibraryURL       string `json:"libraryURL"`
	CallbackURL      string `json:"callbackURL"`
}

RequestData contains the info necessary for submitting a build to a remote service

type ResponseData

type ResponseData struct {
	ID            bson.ObjectId    `json:"id"`
	CreatedBy     string           `json:"createdBy"`
	SubmitTime    time.Time        `json:"submitTime"`
	StartTime     *time.Time       `json:"startTime,omitempty" bson:",omitempty"`
	IsComplete    bool             `json:"isComplete"`
	CompleteTime  *time.Time       `json:"completeTime,omitempty"`
	ImageSize     int64            `json:"imageSize,omitempty"`
	ImageChecksum string           `json:"imageChecksum,omitempty"`
	Definition    types.Definition `json:"definition"`
	WSURL         string           `json:"wsURL,omitempty" bson:"-"`
	LibraryRef    string           `json:"libraryRef"`
	LibraryURL    string           `json:"libraryURL"`
	CallbackURL   string           `json:"callbackURL"`
}

ResponseData contains the details of an individual build

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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