lib

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0+was-not-built-correctly"

Functions

This section is empty.

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, imageId string, 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) 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) Copy

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

Copy will copy the directory/file at from to the path to inside the untarred ACI at a.CurrentACIPath.

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) 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) Run

func (a *ACBuild) Run(cmd []string, insecure bool) (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, a.OverlayWorkPath is the work directory used by overlayfs, and insecure signifies whether downloaded images should be fetched over http or https.

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) 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) 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