docker

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDockerBuilder

func NewDockerBuilder(b *basher.Basher) build.Builder

Types

type Cleanup

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

func (*Cleanup) Clean

func (c *Cleanup) Clean(t *testing.T)

type Docker

type Docker struct {
	Log          io.ReadCloser
	ContainerId  string
	DockerClient *client.Client

	*basher.Basher
	// contains filtered or unexported fields
}

func CreateLivingDockerContainer

func CreateLivingDockerContainer(t *testing.T, ctx context.Context, imageName string) (d *Docker, clean func(t *testing.T))

CreateLivingDockerContainer will:

  • create a docker container with an image from imageName
  • tar up the template directory and serve it on :3333 for testing so the container can download the templates we need
  • return a cleanup function to defer in your tests

*assumes you have an internet connection and are running docker on linux or mac*

func (*Docker) AddGlobalEnvs

func (d *Docker) AddGlobalEnvs(envs []string)

func (*Docker) Close

func (d *Docker) Close() error

func (*Docker) Exec

func (d *Docker) Exec(ctx context.Context, currStage string, currStageStr string, env []string, cmds []string, logout chan []byte) *pb.Result

func (*Docker) Execute

func (d *Docker) Execute(ctx context.Context, stage *pb.Stage, logout chan []byte, commitHash string) *pb.Result

func (*Docker) ExecuteIntegration

func (d *Docker) ExecuteIntegration(ctx context.Context, stage *pb.Stage, stgUtil *build.StageUtil, logout chan []byte) *pb.Result

ExecuteIntegration will basically run Execute but without the cd and run cmds because we are generating the scripts in the code

func (*Docker) GetContainerId

func (d *Docker) GetContainerId() string

func (*Docker) Init

func (d *Docker) Init(ctx context.Context, hash string, logout chan []byte) *pb.Result

func (*Docker) SetGlobalEnv

func (d *Docker) SetGlobalEnv(envs []string)

func (*Docker) Setup

func (d *Docker) Setup(ctx context.Context, logout chan []byte, dockerIdChan chan string, werk *pb.WerkerTask, rc cred.CVRemoteConfig, werkerPort string) (*pb.Result, string)

Jump to

Keyboard shortcuts

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