Documentation ¶
Overview ¶
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func EmitStatus(e *core.NormalizedEmitter, r io.Reader, options *core.PipelineOptions) error
- func GenerateDockerID() (string, error)
- func InferRegistryAndRepository(ctx context.Context, repository string, registry string, ...) (inferredRepository string, inferredRegistry string, err error)
- func NewDockerTransport(options *core.PipelineOptions, dockerOptions *Options, containerID string) (core.Transport, error)
- func NewNilBuilder() *nilBuilder
- func NewServiceBox(config *core.BoxConfig, options *core.PipelineOptions, dockerOptions *Options, ...) (core.ServiceBox, error)
- func NewStep(config *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (core.Step, error)
- func RequireDockerEndpoint(ctx context.Context, options *Options) error
- type Artificer
- type BoxDockerRun
- type Builder
- type ContainerRemover
- type DockerBox
- func (b *DockerBox) AddService(service core.ServiceBox)
- func (b *DockerBox) Clean() error
- func (b *DockerBox) CleanDockerNetwork() 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) GetDockerNetworkName() (string, error)
- func (b *DockerBox) GetID() string
- func (b *DockerBox) GetName() string
- func (b *DockerBox) GetTag() 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, rddURI string) (*docker.Container, error)
- func (b *DockerBox) RunServices(ctx context.Context, env *util.Environment) error
- func (b *DockerBox) Stop()
- type DockerBuild
- func (b *DockerBuild) CollectArtifact(ctx context.Context, containerID string) (*core.Artifact, error)
- func (b *DockerBuild) DockerMessage() string
- func (b *DockerBuild) DockerRepo() string
- func (b *DockerBuild) DockerTag() string
- func (b *DockerBuild) InitEnv(ctx context.Context, hostEnv *util.Environment)
- func (b *DockerBuild) LocalSymlink()
- type DockerBuildStep
- func (s *DockerBuildStep) CollectArtifact(ctx context.Context, containerID string) (*core.Artifact, error)
- func (s *DockerBuildStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *DockerBuildStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *DockerBuildStep) Fetch() (string, error)
- func (s *DockerBuildStep) InitEnv(ctx context.Context, env *util.Environment) error
- func (s *DockerBuildStep) ReportPath(...string) string
- func (s *DockerBuildStep) ShouldSyncEnv() bool
- type DockerClient
- func (c *DockerClient) AttachInteractive(containerID string, cmd []string, initialStdin []string) error
- func (c *DockerClient) AttachTerminal(containerID string) error
- func (c *DockerClient) CreateContainerWithRetries(opts docker.CreateContainerOptions) (*docker.Container, 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(ctx context.Context, containerID string) (*core.Artifact, error)
- func (d *DockerDeploy) DockerMessage() string
- func (d *DockerDeploy) DockerRepo() string
- func (d *DockerDeploy) DockerTag() string
- func (d *DockerDeploy) InitEnv(ctx context.Context, hostEnv *util.Environment)
- func (b *DockerDeploy) LocalSymlink()
- type DockerFileCollector
- type DockerKillStep
- func (s *DockerKillStep) CollectArtifact(context.Context, string) (*core.Artifact, error)
- func (s *DockerKillStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *DockerKillStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *DockerKillStep) Fetch() (string, error)
- func (s *DockerKillStep) InitEnv(ctx context.Context, env *util.Environment) error
- func (s *DockerKillStep) ReportPath(...string) string
- func (s *DockerKillStep) ShouldSyncEnv() bool
- type DockerPipeline
- type DockerPushStep
- func (s *DockerPushStep) CollectArtifact(context.Context, 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(ctx context.Context, env *util.Environment) error
- func (s *DockerPushStep) ReportPath(...string) string
- func (s *DockerPushStep) ShouldSyncEnv() bool
- type DockerRunStep
- func (s *DockerRunStep) Clean()
- func (s *DockerRunStep) CollectArtifact(context.Context, string) (*core.Artifact, error)
- func (s *DockerRunStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *DockerRunStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *DockerRunStep) Fetch() (string, error)
- func (s *DockerRunStep) InitEnv(ctx context.Context, env *util.Environment) error
- func (s *DockerRunStep) ReportPath(...string) string
- func (s *DockerRunStep) ShouldSyncEnv() bool
- type DockerScratchPushStep
- type DockerStep
- type DockerTransport
- type ExportImageOptions
- type ExposedPortMap
- type ExternalServiceBox
- type InternalServiceBox
- type JSONMessageProcessor
- type OfficialDockerClient
- type Options
- type PublishStep
- func (s *PublishStep) CollectArtifact(context.Context, string) (*core.Artifact, error)
- func (s *PublishStep) CollectFile(a, b, c string, dst io.Writer) error
- func (s *PublishStep) Execute(ctx context.Context, sess *core.Session) (int, error)
- func (s *PublishStep) Fetch() (string, error)
- func (s *PublishStep) InitEnv(ctx context.Context, env *util.Environment) error
- func (s *PublishStep) ReportPath(...string) string
- func (s *PublishStep) ShouldSyncEnv() bool
- type ShellStep
- func (s *ShellStep) CollectArtifact(context.Context, 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(ctx context.Context, env *util.Environment) error
- func (s *ShellStep) ReportPath(...string) string
- func (s *ShellStep) ShouldSyncEnv() bool
- type StoreContainerStep
- func (s *StoreContainerStep) CollectArtifact(context.Context, 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(ctx context.Context, env *util.Environment) error
- func (s *StoreContainerStep) ReportPath(...string) string
- func (s *StoreContainerStep) ShouldSyncEnv() bool
- type WatchStep
- func (s *WatchStep) CollectArtifact(context.Context, 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(ctx context.Context, env *util.Environment) error
- func (s *WatchStep) ReportPath(...string) string
- func (s *WatchStep) ShouldSyncEnv() bool
Constants ¶
const ( // DefaultDockerRegistryUsername is an arbitrary value. It is unused by callees, // so the value can be anything so long as it's not empty. DefaultDockerRegistryUsername = "token" DefaultDockerCommand = `/bin/sh -c "if [ -e /bin/bash ]; then /bin/bash; else /bin/sh; fi"` )
const (
NoPushConfirmationInStatus = "Docker push failed to complete. Please check logs for any error condition.."
)
Variables ¶
var (
// DefaultMaxRetriesCreateContainer - Default for maximum no. of CreateContainer retries
DefaultMaxRetriesCreateContainer = 10
)
Functions ¶
func EmitStatus ¶
func EmitStatus(e *core.NormalizedEmitter, r io.Reader, options *core.PipelineOptions) error
EmitStatus emits the json message on r
func GenerateDockerID ¶
GenerateDockerID will generate a cryptographically random 256 bit hex Docker identifier.
func InferRegistryAndRepository ¶
func InferRegistryAndRepository(ctx context.Context, repository string, registry string, pipelineOptions *core.PipelineOptions) (inferredRepository string, inferredRegistry string, err error)
InferRegistryAndRepository infers the registry and repository to be used from input registry and repository.
- If no repository is specified then an error "Repository not specified" will be returned.
- In case a repository is provided but no registry - registry is derived from the name of the domain (if any) from the registry - e.g. for a repository quay.io/<repo-owner>/<repo-name> - quay.io will be the registry host and https://quay.io/v2/ will be the registry url. In case the repository name does not contain a domain name - docker hub is assumed to be the registry and therefore any authorization with supplied username/password is carried out with docker hub.
- In case both repository and registry are provided - 3(a) - In case registry provided points to a wrong url - we use registry inferred from the domain name(if any) prefixed to the repository. However in this case if no domain name is specified in repository - we return an error since user probably wanted to use this repository with a different registry and not docker hub and should be alerted that the registry url is invalid.In case registry url is valid - we evaluate scenarios 4(b) and 4(c) 3(b) - In case no domain name is prefixed to the repository - we assume repository belongs to the registry specified and prefix domain name extracted from registry. 3(c) - In case repository also contains a domain name - we check if domain name of registry and repository are same, we assume that user wanted to use the registry host as specified in repository and change the registry to point to domain name present in repository. If domain names in both registry and repository are same - no changes are made.
func NewDockerTransport ¶
func NewDockerTransport(options *core.PipelineOptions, dockerOptions *Options, containerID string) (core.Transport, error)
NewDockerTransport constructor
func NewNilBuilder ¶
func NewNilBuilder() *nilBuilder
func NewServiceBox ¶
func NewServiceBox(config *core.BoxConfig, options *core.PipelineOptions, dockerOptions *Options, builder Builder) (core.ServiceBox, error)
func NewStep ¶
func NewStep(config *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (core.Step, 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 *Options) *Artificer
NewArtificer returns an Artificer
type BoxDockerRun ¶
type BoxDockerRun struct {
*DockerBox
}
func NewBoxDockerRun ¶
func NewBoxDockerRun(boxConfig *core.BoxConfig, options *core.PipelineOptions, dockerOptions *Options) (*BoxDockerRun, error)
NewBoxDockerRun gives a wrapper for a box.
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 { *container.ContainerCreateCreatedBody // contains filtered or unexported fields }
func TempBusybox ¶
func TempBusybox(ctx context.Context, client *OfficialDockerClient) (*ContainerRemover, error)
type DockerBox ¶
Box is our wrapper for Box operations
func NewDockerBox ¶
func NewDockerBox(boxConfig *core.BoxConfig, options *core.PipelineOptions, dockerOptions *Options) (*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) CleanDockerNetwork ¶
CleanDockerNetwork remove docker network if created for this pipeline.
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) GetDockerNetworkName ¶
GetDockerNetworkName returns docker network name of docker network. If docker network does not exist it creates one and return its name.
func (*DockerBox) RecoverInteractive ¶
RecoverInteractive restarts the box with a terminal attached
func (*DockerBox) Repository ¶
func (*DockerBox) Run ¶
func (b *DockerBox) Run(ctx context.Context, env *util.Environment, rddURI string) (*docker.Container, error)
Run creates the container and runs it. If the pipeline has requested direct docker daemon access then rddURI will be set to the daemon URI that we will give the pipeline access to.
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 *Options, builder Builder) (*DockerBuild, error)
func (*DockerBuild) CollectArtifact ¶
func (b *DockerBuild) CollectArtifact(ctx context.Context, 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(ctx context.Context, 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 DockerBuildStep ¶
DockerBuildStep needs to implement Step
func NewDockerBuildStep ¶
func NewDockerBuildStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (*DockerBuildStep, error)
NewDockerBuildStep is a special step for doing docker builds
func (*DockerBuildStep) CollectArtifact ¶
func (s *DockerBuildStep) CollectArtifact(ctx context.Context, containerID string) (*core.Artifact, error)
CollectArtifact copies the /pipeline/source directory from the running pipeline container and saves it as a directory currentSource and a tarfile currentSource.tar
func (*DockerBuildStep) CollectFile ¶
func (s *DockerBuildStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*DockerBuildStep) InitEnv ¶
func (s *DockerBuildStep) InitEnv(ctx context.Context, env *util.Environment) error
InitEnv parses our data into our config
func (*DockerBuildStep) ReportPath ¶
func (s *DockerBuildStep) ReportPath(...string) string
ReportPath NOP
func (*DockerBuildStep) ShouldSyncEnv ¶
func (s *DockerBuildStep) ShouldSyncEnv() bool
ShouldSyncEnv before running this step = TRUE
type DockerClient ¶
type DockerClient struct { *docker.Client // contains filtered or unexported fields }
DockerClient is our wrapper for docker.Client
func NewDockerClient ¶
func NewDockerClient(options *Options) (*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) CreateContainerWithRetries ¶
func (c *DockerClient) CreateContainerWithRetries(opts docker.CreateContainerOptions) (*docker.Container, error)
CreateContainerWithRetries create a container - retry on "no such image" error
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 *Options, 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(ctx context.Context, 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(ctx context.Context, 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 *OfficialDockerClient, containerID string) *DockerFileCollector
NewDockerFileCollector constructor
type DockerKillStep ¶
DockerKillStep needs to implemenet IStep
func NewDockerKillStep ¶
func NewDockerKillStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (*DockerKillStep, error)
NewDockerKillStep is a special step for killing and removing container.
func (*DockerKillStep) CollectArtifact ¶
CollectArtifact NOP
func (*DockerKillStep) CollectFile ¶
func (s *DockerKillStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*DockerKillStep) InitEnv ¶
func (s *DockerKillStep) InitEnv(ctx context.Context, env *util.Environment) error
InitEnv parses our data into our config
func (*DockerKillStep) ReportPath ¶
func (s *DockerKillStep) ReportPath(...string) string
ReportPath NOP
func (*DockerKillStep) ShouldSyncEnv ¶
func (s *DockerKillStep) ShouldSyncEnv() bool
ShouldSyncEnv before running this step = FALSE
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 *Options, builder Builder) (*DockerPipeline, error)
func (*DockerPipeline) CollectCache ¶
func (p *DockerPipeline) CollectCache(ctx context.Context, 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 *Options) (*DockerPushStep, error)
NewDockerPushStep is a special step for doing docker pushes
func (*DockerPushStep) CollectArtifact ¶
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, tags the image based on tags provided in step options and pushes it to the configured registry when image-name property is not specified, in which case, it tags and pushes an existing image built by a previous internal/docker-build step
func (*DockerPushStep) InitEnv ¶
func (s *DockerPushStep) InitEnv(ctx context.Context, env *util.Environment) error
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 DockerRunStep ¶
type DockerRunStep struct { *core.BaseStep Cmd []string EntryPoint []string WorkingDir string PortBindings map[docker.Port][]docker.PortBinding ExposedPorts map[docker.Port]struct{} User string ContainerName string OriginalContainerName string Image string ContainerID string // contains filtered or unexported fields }
func NewDockerRunStep ¶
func NewDockerRunStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (*DockerRunStep, error)
NewDockerRunStep is a special step for doing docker runs. "image" is the required property for this step. It first checks if the input "image" is build by docker-build and resided in docker-deaon. If not, then it uses the DockerBox logic to fetch the image and starts a new container on that image. The new container is started on the Box network and cleaned up at the end of pipeline.
func (*DockerRunStep) Clean ¶
func (s *DockerRunStep) Clean()
func (*DockerRunStep) CollectArtifact ¶
CollectArtifact NOP
func (*DockerRunStep) CollectFile ¶
func (s *DockerRunStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*DockerRunStep) InitEnv ¶
func (s *DockerRunStep) InitEnv(ctx context.Context, env *util.Environment) error
InitEnv parses our data into our config
func (*DockerRunStep) ReportPath ¶
func (s *DockerRunStep) ReportPath(...string) string
ReportPath NOP
func (*DockerRunStep) ShouldSyncEnv ¶
func (s *DockerRunStep) 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 *Options) (*DockerScratchPushStep, error)
NewDockerScratchPushStep constructorama
func (*DockerScratchPushStep) CollectArtifact ¶
func (s *DockerScratchPushStep) CollectArtifact(ctx context.Context, 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 *Options) (*DockerStep, error)
NewDockerStep ctor
func (*DockerStep) CollectArtifact ¶
func (s *DockerStep) CollectArtifact(ctx context.Context, 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 *Options, 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 *Options) (*InternalServiceBox, error)
NewServiceBox from a name and other references
func (*InternalServiceBox) GetServiceAlias ¶
func (b *InternalServiceBox) GetServiceAlias() string
GetServiceAlias returns service alias for the service.
func (*InternalServiceBox) Run ¶
func (b *InternalServiceBox) Run(ctx context.Context, env *util.Environment, envVars []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, error)
ProcessJSONMessage will take JSONMessage m and generate logs based on the message and previous messages.
type OfficialDockerClient ¶
OfficialDockerClient is a wrapper for client.Client (which makes it easier to substitute a mock for testing)
func DockerOrSkip ¶
func DockerOrSkip(ctx context.Context, t *testing.T) *OfficialDockerClient
DockerOrSkip checks for a docker container and skips the test if one is not available
func NewOfficialDockerClient ¶
func NewOfficialDockerClient(options *Options) (*OfficialDockerClient, error)
NewOfficialDockerClient uses the official docker client to create a Client struct which can be used to perform operations against a docker server
type Options ¶
type Options struct { Host string TLSVerify string CertPath string DNS []string Local bool CPUPeriod int64 CPUQuota int64 Memory int64 MemoryReservation int64 MemorySwap int64 KernelMemory int64 CleanupImage bool NetworkName string RddServiceURI string RddProvisionTimeout time.Duration }
DockerOptions for our docker client
func MinimalDockerOptions ¶
func MinimalDockerOptions() *Options
func NewOptions ¶
NewDockerOptions constructor
type PublishStep ¶
PublishStep needs to implemenet IStep
func NewPublishStep ¶
func NewPublishStep(stepConfig *core.StepConfig, options *core.PipelineOptions, dockerOptions *Options) (*PublishStep, error)
NewPublishStep is a special step for doing docker pushes
func (*PublishStep) CollectArtifact ¶
CollectArtifact NOP
func (*PublishStep) CollectFile ¶
func (s *PublishStep) CollectFile(a, b, c string, dst io.Writer) error
CollectFile NOP
func (*PublishStep) InitEnv ¶
func (s *PublishStep) InitEnv(ctx context.Context, env *util.Environment) error
InitEnv parses our data into our config
func (*PublishStep) ReportPath ¶
func (s *PublishStep) ReportPath(...string) string
ReportPath getter
func (*PublishStep) ShouldSyncEnv ¶
func (s *PublishStep) ShouldSyncEnv() bool
ShouldSyncEnv before running this step = TRUE
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 *Options) (*ShellStep, error)
NewShellStep is a special step for doing docker pushes
func (*ShellStep) CollectArtifact ¶
CollectArtifact NOP
func (*ShellStep) CollectFile ¶
CollectFile NOP
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 *Options) (*StoreContainerStep, error)
NewStoreContainerStep constructor
func (*StoreContainerStep) CollectArtifact ¶
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(ctx context.Context, env *util.Environment) error
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 *Options) (*WatchStep, error)
NewWatchStep is a special step for doing docker pushes
func (*WatchStep) CollectArtifact ¶
CollectArtifact NOP
func (*WatchStep) CollectFile ¶
CollectFile NOP
func (*WatchStep) ShouldSyncEnv ¶
ShouldSyncEnv before running this step = FALSE