lib

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: Apache-2.0 Imports: 28 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when acbuild is asked to remove an element from a
	// list and the element is not present in the list
	ErrNotFound = fmt.Errorf("element to be removed does not exist in this ACI")
)
View Source
var Version = "0.0.0+was-not-built-correctly"

Functions

func CatManifest added in v0.2.0

func CatManifest(aciPath string, prettyPrint bool) (err error)

CatManifest will print to stdout the manifest from the ACI stored at aciPath, optionally inserting whitespace to make it more human readable.

Types

type ACBuild

type ACBuild struct {
	ContextPath          string
	LockPath             string
	CurrentACIPath       string
	DepStoreTarPath      string
	DepStoreExpandedPath string
	OverlayTargetPath    string
	OverlayWorkPath      string
	Debug                bool
	// contains filtered or unexported fields
}

ACBuild contains all the information for a current build. Once an ACBuild has been created, the functions available on it will perform different actions in the build, like updating a dependency or writing a finished ACI.

func NewACBuild

func NewACBuild(cwd string, debug bool) *ACBuild

NewACBuild returns a new ACBuild struct with sane defaults for all of the different paths

func (*ACBuild) AddAnnotation

func (a *ACBuild) AddAnnotation(name, value string) (err error)

AddAnnotation will add an annotation with the given name and value to the untarred ACI stored at a.CurrentACIPath. If the annotation already exists its value will be updated to the new value.

func (*ACBuild) AddDependency

func (a *ACBuild) AddDependency(imageName types.ACIdentifier, imageId *types.Hash, labels types.Labels, size uint) (err error)

AddDependency will add a dependency with the given name, id, labels, and size to the untarred ACI stored at a.CurrentACIPath. If the dependency already exists its fields will be updated to the new values.

func (*ACBuild) AddEnv

func (a *ACBuild) AddEnv(name, value string) (err error)

AddEnv will add an environment variable with the given name and value to the untarred ACI stored at a.CurrentACIPath. If the environment variable already exists its value will be updated to the new value.

func (*ACBuild) AddIsolator added in v0.2.0

func (a *ACBuild) AddIsolator(name string, value []byte) (err error)

func (*ACBuild) AddLabel

func (a *ACBuild) AddLabel(name, value string) (err error)

AddLabel will add a label with the given name and value to the untarred ACI stored at a.CurrentACIPath. If the label already exists its value will be updated to the new value.

func (*ACBuild) AddMount

func (a *ACBuild) AddMount(name, path string, readOnly bool) (err error)

AddMount will add a mount point with the given name and path to the untarred ACI stored at a.CurrentACIPath. If the mount point already exists its value will be updated to the new value. readOnly signifies whether or not the mount point should be read only.

func (*ACBuild) AddPort

func (a *ACBuild) AddPort(name, protocol string, port, count uint, socketActivated bool) (err error)

AddPort will add a port with the given name, protocol, port, and count to the untarred ACI stored at a.CurrentACIPath. If the port already exists its value will be updated to the new value. socketActivated signifies whether or not the application will be socket activated via this port.

func (*ACBuild) Begin

func (a *ACBuild) Begin(start string, insecure bool) (err error)

Begin will start a new build, storing the untarred ACI the build operates on at a.CurrentACIPath. If start is the empty string, the build will begin with an empty ACI, otherwise the ACI stored at start will be used at the starting point.

func (*ACBuild) CatManifest added in v0.2.0

func (a *ACBuild) CatManifest(prettyPrint bool) (err error)

CatManifest will print to stdout the manifest from the expanded ACI stored at a.CurrentACIPath, optionally inserting whitespace to make it more human readable.

func (*ACBuild) CopyToDir added in v0.2.0

func (a *ACBuild) CopyToDir(froms []string, to string) (err error)

CopyToDir will copy all elements specified in the froms slice into the directory inside the current ACI specified by the to string.

func (*ACBuild) CopyToTarget added in v0.2.0

func (a *ACBuild) CopyToTarget(from string, to string) (err error)

CopyToTarget will copy a single file/directory from the from string to the path specified by the to string inside the current ACI.

func (*ACBuild) End

func (a *ACBuild) End() error

End will stop the current build. An error will be returned if no build is in progress.

func (*ACBuild) RemoveAnnotation

func (a *ACBuild) RemoveAnnotation(name string) (err error)

RemoveAnnotation will remove the annotation with the given name from the untarred ACI stored at a.CurrentACIPath

func (*ACBuild) RemoveDependency

func (a *ACBuild) RemoveDependency(imageName string) (err error)

RemoveDependency will remove the dependency with the given name from the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) RemoveEnv

func (a *ACBuild) RemoveEnv(name string) (err error)

RemoveEnv will remove the environment variable with the given name from the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) RemoveIsolator added in v0.2.0

func (a *ACBuild) RemoveIsolator(name string) (err error)

func (*ACBuild) RemoveLabel

func (a *ACBuild) RemoveLabel(name string) (err error)

RemoveLabel will remove the label with the given name from the untarred ACI stored at a.CurrentACIPath

func (*ACBuild) RemoveMount

func (a *ACBuild) RemoveMount(name string) (err error)

RemoveMount will remove the mount point with the given name from the untarred ACI stored at a.CurrentACIPath

func (*ACBuild) RemovePort

func (a *ACBuild) RemovePort(name string) (err error)

RemovePort will remove the port with the given name from the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) ReplaceManifest added in v0.2.0

func (a *ACBuild) ReplaceManifest(manifestPath string) (err error)

ReplaceManifest will replace the manifest in the expanded ACI stored at a.CurrentACIPath with the new manifest stored at manifestPath

func (*ACBuild) Run

func (a *ACBuild) Run(cmd []string, workingDir string, insecure bool, runEngine engine.Engine) (err error)

Run will execute the given command in the ACI being built. a.CurrentACIPath is where the untarred ACI is stored, a.DepStoreTarPath is the directory to download dependencies into, a.DepStoreExpandedPath is where the dependencies are expanded into, and a.OverlayWorkPath is the work directory used by overlayfs.

Arguments:

- cmd: The command to run and its arguments.

- workingDir: If specified, the current directory inside the container is changed to its value before running the given command.

- runEngine: The engine used to perform the execution of the command.

func (*ACBuild) SetExec

func (a *ACBuild) SetExec(cmd []string) (err error)

SetExec sets the exec command for the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) SetGroup

func (a *ACBuild) SetGroup(group string) (err error)

SetGroup sets the group the pod will run as in the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) SetName

func (a *ACBuild) SetName(name string) (err error)

SetName sets the name for the untarred ACI stored at a.CurrentACIPath

func (*ACBuild) SetPostStop added in v0.2.0

func (a *ACBuild) SetPostStop(exec []string) error

SetPostStop sets the post-stop event handler in the expanded ACI stored at a.CurrentACIPath

func (*ACBuild) SetPreStart added in v0.2.0

func (a *ACBuild) SetPreStart(exec []string) error

SetPreStart sets the pre-start event handler in the expanded ACI stored at a.CurrentACIPath

func (*ACBuild) SetUser

func (a *ACBuild) SetUser(user string) (err error)

SetUser sets the user the pod will run as in the untarred ACI stored at a.CurrentACIPath.

func (*ACBuild) SetWorkingDir added in v0.2.0

func (a *ACBuild) SetWorkingDir(dir string) (err error)

SetWorkingDir sets the workingDirectory value in the untarred ACI stored at a.CurrentACIPath

func (*ACBuild) Write

func (a *ACBuild) Write(output string, overwrite, sign bool, gpgflags []string) (err error)

Write will produce the resulting ACI from the current build context, saving it to the given path, optionally signing it.

Jump to

Keyboard shortcuts

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