ci

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Exec string
}

func NewCommand

func NewCommand(cmd string) Command

type Pipeline

type Pipeline struct {
	Context context.Context
	Client  *client.Client

	Stages []*Stage
}

func NewPipeline

func NewPipeline() (*Pipeline, error)

func (*Pipeline) AddStage

func (p *Pipeline) AddStage(stage *Stage)

func (*Pipeline) CleanUp

func (p *Pipeline) CleanUp(contID string)

CleanUp removes the Docker container used by this runtime

func (*Pipeline) ContainerAttach

func (p *Pipeline) ContainerAttach(contID string) (io.ReadCloser, io.ReadCloser, error)

ContainerAttach attach to the container to read the stdout/stderr stream

func (*Pipeline) ContainerCreate

func (p *Pipeline) ContainerCreate(name string, config *container.Config, host *container.HostConfig) (container.ContainerCreateCreatedBody, error)

ContainerCreate creates a container

func (*Pipeline) ContainerStart

func (p *Pipeline) ContainerStart(contID string) error

ContainerStart starts the container

func (*Pipeline) DockerVersion

func (p *Pipeline) DockerVersion() (string, error)

func (*Pipeline) InterruptHandler

func (p *Pipeline) InterruptHandler(stdout, stderr io.ReadCloser, contID string)

InterruptHandler register a handler of Interrupt signal (CTRL+C)

func (*Pipeline) LogWatch

func (p *Pipeline) LogWatch(stdoutTxt, stderrTxt io.Reader, contID, logFileLocation string)

LogWatch tails and reads logs from the container

func (*Pipeline) NetworkConnect

func (p *Pipeline) NetworkConnect(contID, netName string) error

NetworkConnect connects container with a specified network

func (*Pipeline) PullImage

func (p *Pipeline) PullImage(imageName string, force bool) error

PullImage tries to pull an image from the image registry (local, then remote) This code is based on implementation found in awslabs/aws-sam-local repo

type Stage

type Stage struct {
	Name     string
	Commands []Command
}

func NewStage

func NewStage(name string, cmds []Command) *Stage

Jump to

Keyboard shortcuts

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