dockerlocal

package
v0.0.0-...-9e9b4ff Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: Apache-2.0 Imports: 49 Imported by: 0

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

View Source
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"`
)
View Source
const (
	NoPushConfirmationInStatus = "Docker push failed to complete. Please check logs for any error condition.."
)

Variables

View Source
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

func GenerateDockerID() (string, error)

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.

  1. If no repository is specified then an error "Repository not specified" will be returned.
  2. 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.
  3. 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)

func RequireDockerEndpoint

func RequireDockerEndpoint(ctx context.Context, options *Options) error

RequireDockerEndpoint attempts to connect to the specified docker daemon and returns an error if unsuccessful

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

func (*Artificer) Collect

func (a *Artificer) Collect(ctx context.Context, artifact *core.Artifact) (*core.Artifact, error)

Collect an artifact from the container, if it doesn't have any files in the tarball return util.ErrEmptyTarball

func (*Artificer) Upload

func (a *Artificer) Upload(artifact *core.Artifact) error

Upload an artifact

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)

func (*ContainerRemover) Remove

func (c *ContainerRemover) Remove(ctx context.Context) error

type DockerBox

type DockerBox struct {
	Name      string
	ShortName string
	// contains filtered or unexported fields
}

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

func (b *DockerBox) Clean() error

Clean up the containers

func (*DockerBox) CleanDockerNetwork

func (b *DockerBox) CleanDockerNetwork() error

CleanDockerNetwork remove docker network if created for this pipeline.

func (*DockerBox) Commit

func (b *DockerBox) Commit(name, tag, message string, cleanup bool) (*docker.Image, error)

Commit the current running Docker container to an Docker image.

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

func (b *DockerBox) Fetch(ctx context.Context, env *util.Environment) (*docker.Image, error)

Fetch an image (or update the local)

func (*DockerBox) GetDockerNetworkName

func (b *DockerBox) GetDockerNetworkName() (string, error)

GetDockerNetworkName returns docker network name of docker network. If docker network does not exist it creates one and return its name.

func (*DockerBox) GetID

func (b *DockerBox) GetID() string

GetID gets the container ID or empty string if we don't have a container

func (*DockerBox) GetName

func (b *DockerBox) GetName() string

GetName gets the box name

func (*DockerBox) GetTag

func (b *DockerBox) GetTag() string

func (*DockerBox) RecoverInteractive

func (b *DockerBox) RecoverInteractive(cwd string, pipeline core.Pipeline, step core.Step) error

RecoverInteractive restarts the box with a terminal attached

func (*DockerBox) Repository

func (b *DockerBox) Repository() string

func (*DockerBox) Restart

func (b *DockerBox) Restart() (*docker.Container, error)

Restart stops and starts the box

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

func (b *DockerBox) RunServices(ctx context.Context, env *util.Environment) error

RunServices runs the services associated with this box

func (*DockerBox) Stop

func (b *DockerBox) Stop()

Stop the box and all its services

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 (b *DockerBuild) LocalSymlink()

LocalSymlink makes an easy to use symlink to find the latest run

type DockerBuildStep

type DockerBuildStep struct {
	*core.BaseStep
	// contains filtered or unexported fields
}

DockerBuildStep needs to implemenet 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) Execute

func (s *DockerBuildStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute builds an image

func (*DockerBuildStep) Fetch

func (s *DockerBuildStep) Fetch() (string, error)

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

func (c *DockerClient) ExecOne(containerID string, cmd []string, output io.Writer) error

ExecOne uses docker exec to run a command in the container

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

func (*DockerFileCollector) Collect

func (fc *DockerFileCollector) Collect(ctx context.Context, path string) (*util.Archive, error)

Collect grabs a path and returns an Archive containing the stream. The caller must call Close() on the returned Archive after it has finished with it.

type DockerKillStep

type DockerKillStep struct {
	*core.BaseStep
	// contains filtered or unexported fields
}

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

func (s *DockerKillStep) CollectArtifact(context.Context, string) (*core.Artifact, error)

CollectArtifact NOP

func (*DockerKillStep) CollectFile

func (s *DockerKillStep) CollectFile(a, b, c string, dst io.Writer) error

CollectFile NOP

func (*DockerKillStep) Execute

func (s *DockerKillStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute kills container

func (*DockerKillStep) Fetch

func (s *DockerKillStep) Fetch() (string, error)

Fetch 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

type DockerPushStep struct {
	*core.BaseStep
	// contains filtered or unexported fields
}

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

func (s *DockerPushStep) CollectArtifact(context.Context, 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

func (s *DockerPushStep) Execute(ctx context.Context, sess *core.Session) (int, error)

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

func (s *DockerPushStep) Fetch() (string, error)

Fetch NOP

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

func (s *DockerRunStep) CollectArtifact(context.Context, string) (*core.Artifact, error)

CollectArtifact NOP

func (*DockerRunStep) CollectFile

func (s *DockerRunStep) CollectFile(a, b, c string, dst io.Writer) error

CollectFile NOP

func (*DockerRunStep) Execute

func (s *DockerRunStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute creates the container and starts the container.

func (*DockerRunStep) Fetch

func (s *DockerRunStep) Fetch() (string, error)

Fetch 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

func (*DockerScratchPushStep) Execute

func (s *DockerScratchPushStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute the scratch-n-push

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

func (*DockerTransport) Attach

func (t *DockerTransport) Attach(sessionCtx context.Context, stdin io.Reader, stdout, stderr io.Writer) (context.Context, error)

Attach the given reader and writers to the transport, return a context that will be closed when the transport dies

type ExportImageOptions

type ExportImageOptions struct {
	Name         string
	OutputStream io.Writer
}

ExportImageOptions are the options available for ExportImage.

type ExposedPortMap

type ExposedPortMap struct {
	ContainerPort string
	HostURI       string
}

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

type OfficialDockerClient struct {
	*client.Client
}

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

func NewOptions(ctx context.Context, c util.Settings, e *util.Environment) (*Options, error)

NewDockerOptions constructor

type PublishStep

type PublishStep struct {
	*core.BaseStep
	// contains filtered or unexported fields
}

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

func (s *PublishStep) CollectArtifact(context.Context, string) (*core.Artifact, error)

CollectArtifact NOP

func (*PublishStep) CollectFile

func (s *PublishStep) CollectFile(a, b, c string, dst io.Writer) error

CollectFile NOP

func (*PublishStep) Execute

func (s *PublishStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute a shell and give it to the user

func (*PublishStep) Fetch

func (s *PublishStep) Fetch() (string, error)

Fetch 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

func (s *ShellStep) CollectArtifact(context.Context, string) (*core.Artifact, error)

CollectArtifact NOP

func (*ShellStep) CollectFile

func (s *ShellStep) CollectFile(a, b, c string, dst io.Writer) error

CollectFile NOP

func (*ShellStep) Execute

func (s *ShellStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute a shell and give it to the user

func (*ShellStep) Fetch

func (s *ShellStep) Fetch() (string, error)

Fetch NOP

func (*ShellStep) InitEnv

func (s *ShellStep) InitEnv(ctx context.Context, env *util.Environment) error

InitEnv parses our data into our config

func (*ShellStep) ReportPath

func (s *ShellStep) ReportPath(...string) string

ReportPath getter

func (*ShellStep) ShouldSyncEnv

func (s *ShellStep) ShouldSyncEnv() bool

ShouldSyncEnv before running this step = TRUE

type StoreContainerStep

type StoreContainerStep struct {
	*core.BaseStep
	// contains filtered or unexported fields
}

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

func (s *StoreContainerStep) CollectArtifact(context.Context, 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) Execute

func (s *StoreContainerStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute does the actual export and upload of the container

func (*StoreContainerStep) Fetch

func (s *StoreContainerStep) Fetch() (string, error)

Fetch NOP

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

type WatchStep struct {
	*core.BaseStep
	Code string
	// contains filtered or unexported fields
}

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

func (s *WatchStep) CollectArtifact(context.Context, string) (*core.Artifact, error)

CollectArtifact NOP

func (*WatchStep) CollectFile

func (s *WatchStep) CollectFile(a, b, c string, dst io.Writer) error

CollectFile NOP

func (*WatchStep) Execute

func (s *WatchStep) Execute(ctx context.Context, sess *core.Session) (int, error)

Execute runs a command and optionally reloads it

func (*WatchStep) Fetch

func (s *WatchStep) Fetch() (string, error)

Fetch NOP

func (*WatchStep) InitEnv

func (s *WatchStep) InitEnv(ctx context.Context, env *util.Environment) error

InitEnv parses our data into our config

func (*WatchStep) ReportPath

func (s *WatchStep) ReportPath(...string) string

ReportPath getter

func (*WatchStep) ShouldSyncEnv

func (s *WatchStep) ShouldSyncEnv() bool

ShouldSyncEnv before running this step = FALSE

Jump to

Keyboard shortcuts

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