Documentation ¶
Index ¶
- func EmitStatus(e *core.NormalizedEmitter, r io.Reader, options *core.PipelineOptions)
- func GenerateDockerID() (string, error)
- func NewDockerTransport(options *core.PipelineOptions, dockerOptions *DockerOptions, ...) (core.Transport, error)
- func NewNilBuilder() *nilBuilder
- func NewServiceBox(config *core.BoxConfig, options *core.PipelineOptions, ...) (core.ServiceBox, error)
- func NewStep(config *core.StepConfig, options *core.PipelineOptions, ...) (core.Step, error)
- func RequireDockerEndpoint(options *DockerOptions) error
- type Artificer
- type Builder
- type ContainerRemover
- type DockerBox
- func (b *DockerBox) AddService(service core.ServiceBox)
- func (b *DockerBox) Clean() error
- func (b *DockerBox) Commit(name, tag, message string, cleanup bool) (*docker.Image, error)
- func (b *DockerBox) ExportImage(options *ExportImageOptions) error
- func (b *DockerBox) Fetch(ctx context.Context, env *util.Environment) (*docker.Image, error)
- func (b *DockerBox) GetID() string
- func (b *DockerBox) GetName() string
- func (b *DockerBox) GetTag() string
- func (b *DockerBox) Link() string
- func (b *DockerBox) RecoverInteractive(cwd string, pipeline core.Pipeline, step core.Step) error
- func (b *DockerBox) Repository() string
- func (b *DockerBox) Restart() (*docker.Container, error)
- func (b *DockerBox) Run(ctx context.Context, env *util.Environment) (*docker.Container, error)
- func (b *DockerBox) RunServices(ctx context.Context, env *util.Environment) error
- func (b *DockerBox) Stop()
- type DockerBuild
- func (b *DockerBuild) CollectArtifact(containerID string) (*core.Artifact, error)
- func (b *DockerBuild) DockerMessage() string
- func (b *DockerBuild) DockerRepo() string
- func (b *DockerBuild) DockerTag() string
- func (b *DockerBuild) InitEnv(hostEnv *util.Environment)
- func (b *DockerBuild) LocalSymlink()
- type DockerClient
- func (c *DockerClient) AttachInteractive(containerID string, cmd []string, initialStdin []string) error
- func (c *DockerClient) AttachTerminal(containerID string) error
- func (c *DockerClient) ExecOne(containerID string, cmd []string, output io.Writer) error
- func (c *DockerClient) ResizeTTY(execID string) error
- func (c *DockerClient) RunAndAttach(name string) error
- type DockerDeploy
- func (d *DockerDeploy) CollectArtifact(containerID string) (*core.Artifact, error)
- func (d *DockerDeploy) DockerMessage() string
- func (d *DockerDeploy) DockerRepo() string
- func (d *DockerDeploy) DockerTag() string
- func (d *DockerDeploy) InitEnv(hostEnv *util.Environment)
- func (b *DockerDeploy) LocalSymlink()
- type DockerFileCollector
- type DockerOptions
- type DockerPipeline
- type DockerPushStep
- func (s *DockerPushStep) CollectArtifact(string) (*core.Artifact, error)
- func (s *DockerPushStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *DockerPushStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *DockerPushStep) Fetch() (string, error)
- func (s *DockerPushStep) InitEnv(env *util.Environment)
- func (s *DockerPushStep) ReportPath(...string) string
- func (s *DockerPushStep) ShouldSyncEnv() bool
- type DockerScratchPushStep
- type DockerStep
- type DockerTransport
- type ExportImageOptions
- type ExposedPortMap
- type ExternalServiceBox
- type InternalServiceBox
- type JSONMessageProcessor
- type ShellStep
- func (s *ShellStep) CollectArtifact(string) (*core.Artifact, error)
- func (s *ShellStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *ShellStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *ShellStep) Fetch() (string, error)
- func (s *ShellStep) InitEnv(env *util.Environment)
- func (s *ShellStep) ReportPath(...string) string
- func (s *ShellStep) ShouldSyncEnv() bool
- type StoreContainerStep
- func (s *StoreContainerStep) CollectArtifact(string) (*core.Artifact, error)
- func (s *StoreContainerStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *StoreContainerStep) DockerMessage() string
- func (s *StoreContainerStep) DockerRepo() string
- func (s *StoreContainerStep) DockerTag() string
- func (s *StoreContainerStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *StoreContainerStep) Fetch() (string, error)
- func (s *StoreContainerStep) InitEnv(env *util.Environment)
- func (s *StoreContainerStep) ReportPath(...string) string
- func (s *StoreContainerStep) ShouldSyncEnv() bool
- type WatchStep
- func (s *WatchStep) CollectArtifact(string) (*core.Artifact, error)
- func (s *WatchStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *WatchStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *WatchStep) Fetch() (string, error)
- func (s *WatchStep) InitEnv(env *util.Environment)
- func (s *WatchStep) ReportPath(...string) string
- func (s *WatchStep) ShouldSyncEnv() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitStatus ¶
func EmitStatus(e *core.NormalizedEmitter, r io.Reader, options *core.PipelineOptions)
EmitStatus emits the json message on r
func GenerateDockerID ¶
GenerateDockerID will generate a cryptographically random 256 bit hex Docker identifier.
func NewDockerTransport ¶
func NewDockerTransport(options *core.PipelineOptions, dockerOptions *DockerOptions, containerID string) (core.Transport, error)
NewDockerTransport constructor
func NewNilBuilder ¶
func NewNilBuilder() *nilBuilder
func NewServiceBox ¶
func NewServiceBox(config *core.BoxConfig, options *core.PipelineOptions, dockerOptions *DockerOptions, builder Builder) (core.ServiceBox, error)
func NewStep ¶
func NewStep(config *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (core.Step, error)
func RequireDockerEndpoint ¶
func RequireDockerEndpoint(options *DockerOptions) error
Types ¶
type Artificer ¶
type Artificer struct {
// contains filtered or unexported fields
}
Artificer collects artifacts from containers and uploads them.
func NewArtificer ¶
func NewArtificer(options *core.PipelineOptions, dockerOptions *DockerOptions) *Artificer
NewArtificer returns an Artificer
type Builder ¶
type Builder interface {
Build(context.Context, *util.Environment, *core.BoxConfig) (*DockerBox, *docker.Image, error)
}
Builder interface to create an image based on a service config kinda needed so we can break a bunch of circular dependencies with cmd
type ContainerRemover ¶
type ContainerRemover struct { *docker.Container // contains filtered or unexported fields }
func TempBusybox ¶
func TempBusybox(client *DockerClient) (*ContainerRemover, error)
func (*ContainerRemover) Remove ¶
func (c *ContainerRemover) Remove()
type DockerBox ¶
Box is our wrapper for Box operations
func NewDockerBox ¶
func NewDockerBox(boxConfig *core.BoxConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*DockerBox, error)
NewDockerBox from a name and other references
func (*DockerBox) AddService ¶
func (b *DockerBox) AddService(service core.ServiceBox)
AddService needed by this Box
func (*DockerBox) ExportImage ¶
func (b *DockerBox) ExportImage(options *ExportImageOptions) error
ExportImage will export the image to a temporary file and return the path to the file.
func (*DockerBox) RecoverInteractive ¶
RecoverInteractive restarts the box with a terminal attached
func (*DockerBox) Repository ¶
func (*DockerBox) RunServices ¶
RunServices runs the services associated with this box
type DockerBuild ¶
type DockerBuild struct {
*DockerPipeline
}
func NewDockerBuild ¶
func NewDockerBuild(name string, config *core.Config, options *core.PipelineOptions, dockerOptions *DockerOptions, builder Builder) (*DockerBuild, error)
func (*DockerBuild) CollectArtifact ¶
func (b *DockerBuild) CollectArtifact(containerID string) (*core.Artifact, error)
CollectArtifact copies the artifacts associated with the Build.
func (*DockerBuild) DockerMessage ¶
func (b *DockerBuild) DockerMessage() string
DockerMessage calculates our message
func (*DockerBuild) DockerRepo ¶
func (b *DockerBuild) DockerRepo() string
DockerRepo calculates our repo name
func (*DockerBuild) DockerTag ¶
func (b *DockerBuild) DockerTag() string
DockerTag calculates our tag
func (*DockerBuild) InitEnv ¶
func (b *DockerBuild) InitEnv(hostEnv *util.Environment)
InitEnv sets up the internal state of the environment for the build
func (*DockerBuild) LocalSymlink ¶
func (b *DockerBuild) LocalSymlink()
LocalSymlink makes an easy to use symlink to find the latest run
type DockerClient ¶
type DockerClient struct { *docker.Client // contains filtered or unexported fields }
DockerClient is our wrapper for docker.Client
func DockerOrSkip ¶
func DockerOrSkip(t *testing.T) *DockerClient
DockerOrSkip checks for a docker container and skips the test if one is not available
func NewDockerClient ¶
func NewDockerClient(options *DockerOptions) (*DockerClient, error)
NewDockerClient based on options and env
func (*DockerClient) AttachInteractive ¶
func (c *DockerClient) AttachInteractive(containerID string, cmd []string, initialStdin []string) error
AttachInteractive starts an interactive session and runs cmd
func (*DockerClient) AttachTerminal ¶
func (c *DockerClient) AttachTerminal(containerID string) error
AttachTerminal connects us to container and gives us a terminal
func (*DockerClient) ResizeTTY ¶
func (c *DockerClient) ResizeTTY(execID string) error
ResizeTTY resizes the tty size of docker connection so output looks normal
func (*DockerClient) RunAndAttach ¶
func (c *DockerClient) RunAndAttach(name string) error
RunAndAttach gives us a raw connection to a newly run container
type DockerDeploy ¶
type DockerDeploy struct {
*DockerPipeline
}
DockerDeploy is our basic wrapper for DockerDeploy operations
func NewDockerDeploy ¶
func NewDockerDeploy(name string, config *core.Config, options *core.PipelineOptions, dockerOptions *DockerOptions, builder Builder) (*DockerDeploy, error)
ToDeploy grabs the build section from the config and configures all the instances necessary for the build
func (*DockerDeploy) CollectArtifact ¶
func (d *DockerDeploy) CollectArtifact(containerID string) (*core.Artifact, error)
CollectArtifact copies the artifacts associated with the Deploy. Unlike a Build, this will only collect the output directory if we made a new one.
func (*DockerDeploy) DockerMessage ¶
func (d *DockerDeploy) DockerMessage() string
DockerMessage returns the message to store this with in docker
func (*DockerDeploy) DockerRepo ¶
func (d *DockerDeploy) DockerRepo() string
DockerRepo returns the name where we might store this in docker
func (*DockerDeploy) DockerTag ¶
func (d *DockerDeploy) DockerTag() string
DockerTag returns the tag where we might store this in docker
func (*DockerDeploy) InitEnv ¶
func (d *DockerDeploy) InitEnv(hostEnv *util.Environment)
InitEnv sets up the internal state of the environment for the build
func (*DockerDeploy) LocalSymlink ¶
func (b *DockerDeploy) LocalSymlink()
LocalSymlink makes an easy to use symlink to find the latest run
type DockerFileCollector ¶
type DockerFileCollector struct {
// contains filtered or unexported fields
}
DockerFileCollector impl of FileCollector
func NewDockerFileCollector ¶
func NewDockerFileCollector(client *DockerClient, containerID string) *DockerFileCollector
NewDockerFileCollector constructor
type DockerOptions ¶
type DockerOptions struct { DockerHost string DockerTLSVerify string DockerCertPath string DockerDNS []string DockerLocal bool }
DockerOptions for our docker client
func MinimalDockerOptions ¶
func MinimalDockerOptions() *DockerOptions
func NewDockerOptions ¶
func NewDockerOptions(c util.Settings, e *util.Environment) (*DockerOptions, error)
NewDockerOptions constructor
type DockerPipeline ¶
type DockerPipeline struct { *core.BasePipeline // contains filtered or unexported fields }
DockerPipeline is our docker PipelineConfigurer and Pipeline impl
func NewDockerPipeline ¶
func NewDockerPipeline(name string, config *core.Config, options *core.PipelineOptions, dockerOptions *DockerOptions, builder Builder) (*DockerPipeline, error)
func (*DockerPipeline) CollectCache ¶
func (p *DockerPipeline) CollectCache(containerID string) error
CollectCache extracts the cache from the container to the cachedir
type DockerPushStep ¶
DockerPushStep needs to implemenet IStep
func NewDockerPushStep ¶
func NewDockerPushStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*DockerPushStep, error)
NewDockerPushStep is a special step for doing docker pushes
func (*DockerPushStep) CollectArtifact ¶
func (s *DockerPushStep) CollectArtifact(string) (*core.Artifact, error)
CollectArtifact NOP
func (*DockerPushStep) CollectFile ¶
func (s *DockerPushStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*DockerPushStep) Execute ¶
Execute commits the current container and pushes it to the configured registry
func (*DockerPushStep) InitEnv ¶
func (s *DockerPushStep) InitEnv(env *util.Environment)
InitEnv parses our data into our config
func (*DockerPushStep) ReportPath ¶
func (s *DockerPushStep) ReportPath(...string) string
ReportPath NOP
func (*DockerPushStep) ShouldSyncEnv ¶
func (s *DockerPushStep) ShouldSyncEnv() bool
ShouldSyncEnv before running this step = TRUE
type DockerScratchPushStep ¶
type DockerScratchPushStep struct {
*DockerPushStep
}
DockerScratchPushStep creates a new image based on a scratch tarball and pushes it
func NewDockerScratchPushStep ¶
func NewDockerScratchPushStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*DockerScratchPushStep, error)
NewDockerScratchPushStep constructorama
func (*DockerScratchPushStep) CollectArtifact ¶
func (s *DockerScratchPushStep) CollectArtifact(containerID string) (*core.Artifact, error)
CollectArtifact is copied from the build, we use this to get the layer tarball that we'll include in the image tarball
type DockerStep ¶
type DockerStep struct { *core.ExternalStep // contains filtered or unexported fields }
DockerStep is an external step that knows how to fetch artifacts
func NewDockerStep ¶
func NewDockerStep(config *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*DockerStep, error)
NewDockerStep ctor
func (*DockerStep) CollectArtifact ¶
func (s *DockerStep) CollectArtifact(containerID string) (*core.Artifact, error)
CollectArtifact copies the artifacts associated with the Step.
func (*DockerStep) CollectFile ¶
func (s *DockerStep) CollectFile(containerID, path, name string, dst io.Writer) error
CollectFile gets an individual file from the container
type DockerTransport ¶
type DockerTransport struct {
// contains filtered or unexported fields
}
DockerTransport for docker containers
type ExportImageOptions ¶
ExportImageOptions are the options available for ExportImage.
type ExposedPortMap ¶
ExposedPortMap contains port forwarding information
type ExternalServiceBox ¶
type ExternalServiceBox struct { *InternalServiceBox // contains filtered or unexported fields }
ExternalServiceBox wraps a box as a service
func NewExternalServiceBox ¶
func NewExternalServiceBox(boxConfig *core.BoxConfig, options *core.PipelineOptions, dockerOptions *DockerOptions, builder Builder) (*ExternalServiceBox, error)
NewExternalServiceBox gives us an ExternalServiceBox from config
func (*ExternalServiceBox) Fetch ¶
func (s *ExternalServiceBox) Fetch(ctx context.Context, env *util.Environment) (*docker.Image, error)
Fetch the image representation of an ExternalServiceBox this means running the ExternalServiceBox and comitting the image
type InternalServiceBox ¶
type InternalServiceBox struct { *DockerBox // contains filtered or unexported fields }
InternalServiceBox wraps a box as a service
func NewInternalServiceBox ¶
func NewInternalServiceBox(boxConfig *core.BoxConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*InternalServiceBox, error)
NewServiceBox from a name and other references
func (*InternalServiceBox) Run ¶
func (b *InternalServiceBox) Run(ctx context.Context, env *util.Environment, links []string) (*docker.Container, error)
Run executes the service
type JSONMessageProcessor ¶
type JSONMessageProcessor struct {
// contains filtered or unexported fields
}
A JSONMessageProcessor will process JSONMessages and generate logs.
func NewJSONMessageProcessor ¶
func NewJSONMessageProcessor() *JSONMessageProcessor
NewJSONMessageProcessor will create a new JSONMessageProcessor and initialize it.
func (*JSONMessageProcessor) ProcessJSONMessage ¶
func (s *JSONMessageProcessor) ProcessJSONMessage(m *jsonmessage.JSONMessage) string
ProcessJSONMessage will take JSONMessage m and generate logs based on the message and previous messages.
type ShellStep ¶
type ShellStep struct { *core.BaseStep Code string Cmd []string // contains filtered or unexported fields }
ShellStep needs to implemenet IStep
func NewShellStep ¶
func NewShellStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*ShellStep, error)
NewShellStep is a special step for doing docker pushes
func (*ShellStep) CollectArtifact ¶
CollectArtifact NOP
func (*ShellStep) CollectFile ¶
CollectFile NOP
func (*ShellStep) InitEnv ¶
func (s *ShellStep) InitEnv(env *util.Environment)
InitEnv parses our data into our config
func (*ShellStep) ShouldSyncEnv ¶
ShouldSyncEnv before running this step = TRUE
type StoreContainerStep ¶
StoreContainerStep stores the container that was built
func NewStoreContainerStep ¶
func NewStoreContainerStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*StoreContainerStep, error)
NewStoreContainerStep constructor
func (*StoreContainerStep) CollectArtifact ¶
func (s *StoreContainerStep) CollectArtifact(string) (*core.Artifact, error)
CollectArtifact return an artifact pointing at the exported thing we made
func (*StoreContainerStep) CollectFile ¶
func (s *StoreContainerStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*StoreContainerStep) DockerMessage ¶
func (s *StoreContainerStep) DockerMessage() string
DockerMessage calculates our message
func (*StoreContainerStep) DockerRepo ¶
func (s *StoreContainerStep) DockerRepo() string
DockerRepo calculates our repo name
func (*StoreContainerStep) DockerTag ¶
func (s *StoreContainerStep) DockerTag() string
DockerTag calculates our tag
func (*StoreContainerStep) InitEnv ¶
func (s *StoreContainerStep) InitEnv(env *util.Environment)
InitEnv preps our env
func (*StoreContainerStep) ReportPath ¶
func (s *StoreContainerStep) ReportPath(...string) string
ReportPath NOP
func (*StoreContainerStep) ShouldSyncEnv ¶
func (s *StoreContainerStep) ShouldSyncEnv() bool
ShouldSyncEnv before running this step = TRUE
type WatchStep ¶
WatchStep needs to implemenet IStep
func NewWatchStep ¶
func NewWatchStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *DockerOptions) (*WatchStep, error)
NewWatchStep is a special step for doing docker pushes
func (*WatchStep) CollectArtifact ¶
CollectArtifact NOP
func (*WatchStep) CollectFile ¶
CollectFile NOP
func (*WatchStep) InitEnv ¶
func (s *WatchStep) InitEnv(env *util.Environment)
InitEnv parses our data into our config
func (*WatchStep) ShouldSyncEnv ¶
ShouldSyncEnv before running this step = FALSE