context

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteContext

type ExecuteContext struct {
	Resources *ResourceCollection
	Client    client.DockerClient

	WorkingDir string
	ConfigFile string
	Env        *execenv.ExecEnv
	Settings   Settings
	// contains filtered or unexported fields
}

ExecuteContext contains all the context for task execution

func NewExecuteContext

func NewExecuteContext(
	config *config.Config,
	client client.DockerClient,
	execEnv *execenv.ExecEnv,
	settings Settings,
) *ExecuteContext

NewExecuteContext craetes a new empty ExecuteContext

func (*ExecuteContext) GetAuthConfig

func (ctx *ExecuteContext) GetAuthConfig(repo string) docker.AuthConfiguration

GetAuthConfig returns the auth configuration for the repo

func (*ExecuteContext) GetAuthConfigs

func (ctx *ExecuteContext) GetAuthConfigs() docker.AuthConfigurations

GetAuthConfigs returns all the authorization configs in the config file. This is used by build, because the repo isn't known until after the Dockerfile is parsed.

func (*ExecuteContext) IsModified

func (ctx *ExecuteContext) IsModified(names ...task.Name) bool

IsModified returns true if any of the tasks named in names has been modified during this execution

func (*ExecuteContext) SetModified

func (ctx *ExecuteContext) SetModified(name task.Name)

SetModified sets the task name as modified

type ResourceCollection

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

ResourceCollection holds resource configs that are used by other resources TODO: this type can be removed if config.Config is changed to store resources grouped by type, instead of as a single map

func (*ResourceCollection) Add

func (c *ResourceCollection) Add(name string, resource config.Resource)

Add a resource to the collection

func (*ResourceCollection) EachMount

func (c *ResourceCollection) EachMount(names []string, f eachMountFunc)

EachMount iterates all the mounts in names and calls f for each

func (*ResourceCollection) Image

func (c *ResourceCollection) Image(name string) *config.ImageConfig

Image returns an config.ImageConfig by name

func (*ResourceCollection) Mount

func (c *ResourceCollection) Mount(name string) *config.MountConfig

Mount returns a config.MountConfig by name

type Settings

type Settings struct {
	Quiet     bool
	BindMount bool
}

Settings are flags that can be set by a user to change the behaviour of some tasks

func NewSettings

func NewSettings(quiet bool, bindMount bool) Settings

NewSettings returns a new Settings

Jump to

Keyboard shortcuts

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