backend

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2015 License: MIT Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStaleVM               = fmt.Errorf("previous build artifacts found on stale vm")
	ErrMissingEndpointConfig = fmt.Errorf("expected config key endpoint")
)

Functions

This section is empty.

Types

type DockerInstance

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

func (*DockerInstance) ID

func (i *DockerInstance) ID() string

func (*DockerInstance) RunScript

func (i *DockerInstance) RunScript(ctx gocontext.Context, output io.WriteCloser) (*RunResult, error)

func (*DockerInstance) Stop

func (i *DockerInstance) Stop(ctx gocontext.Context) error

func (*DockerInstance) UploadScript

func (i *DockerInstance) UploadScript(ctx gocontext.Context, script []byte) error

type DockerProvider

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

func NewDockerProvider

func NewDockerProvider(cfg *config.ProviderConfig) (*DockerProvider, error)

func (*DockerProvider) Start

func (p *DockerProvider) Start(ctx gocontext.Context, startAttributes *StartAttributes) (Instance, error)

type FakeInstance

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

func (*FakeInstance) ID

func (i *FakeInstance) ID() string

func (*FakeInstance) RunScript

func (i *FakeInstance) RunScript(ctx context.Context, writer io.WriteCloser) (*RunResult, error)

func (*FakeInstance) Stop

func (i *FakeInstance) Stop(ctx context.Context) error

func (*FakeInstance) UploadScript

func (i *FakeInstance) UploadScript(ctx context.Context, script []byte) error

type FakeProvider

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

func NewFakeProvider

func NewFakeProvider(logOutput []byte) *FakeProvider

func (*FakeProvider) Start

type Instance

type Instance interface {
	// UploadScript uploads the given script to the instance. The script is
	// a bash script with a shebang (#!/bin/bash) line. Note that this
	// method should not be called multiple times.
	UploadScript(context.Context, []byte) error

	// RunScript runs the build script that was uploaded with the
	// UploadScript method.
	RunScript(context.Context, io.WriteCloser) (*RunResult, error)
	Stop(context.Context) error

	// ID is used when identifying the instance in logs and such
	ID() string
}

An Instance is something that can run a build script.

type JupiterBrainInstance

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

func (*JupiterBrainInstance) ID

func (i *JupiterBrainInstance) ID() string

func (*JupiterBrainInstance) RunScript

func (i *JupiterBrainInstance) RunScript(ctx context.Context, output io.WriteCloser) (*RunResult, error)

func (*JupiterBrainInstance) Stop

func (*JupiterBrainInstance) UploadScript

func (i *JupiterBrainInstance) UploadScript(ctx context.Context, script []byte) error

type JupiterBrainProvider

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

func NewJupiterBrainProvider

func NewJupiterBrainProvider(cfg *config.ProviderConfig) (*JupiterBrainProvider, error)

func (*JupiterBrainProvider) Start

func (p *JupiterBrainProvider) Start(ctx context.Context, startAttributes *StartAttributes) (Instance, error)

type Provider

type Provider interface {
	// Start starts an instance. It shouldn't return until the instance is
	// ready to call UploadScript on (this may, for example, mean that it
	// waits for SSH connections to be possible).
	Start(context.Context, *StartAttributes) (Instance, error)
}

Provider represents some kind of instance provider. It can point to an external HTTP API, or some process locally, or something completely different.

func NewProvider

func NewProvider(name string, cfg *config.ProviderConfig) (Provider, error)

type RunResult

type RunResult struct {
	ExitCode  uint8
	Completed bool
}

type SauceLabsInstance

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

func (*SauceLabsInstance) ID

func (i *SauceLabsInstance) ID() string

func (*SauceLabsInstance) RunScript

func (i *SauceLabsInstance) RunScript(ctx context.Context, output io.WriteCloser) (*RunResult, error)

func (*SauceLabsInstance) Stop

func (i *SauceLabsInstance) Stop(ctx context.Context) error

func (*SauceLabsInstance) UploadScript

func (i *SauceLabsInstance) UploadScript(ctx context.Context, script []byte) error

type SauceLabsProvider

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

func NewSauceLabsProvider

func NewSauceLabsProvider(cfg *config.ProviderConfig) (*SauceLabsProvider, error)

func (*SauceLabsProvider) Start

func (p *SauceLabsProvider) Start(ctx context.Context, startAttributes *StartAttributes) (Instance, error)

type StartAttributes

type StartAttributes struct {
	Language string `json:"language"`
	OsxImage string `json:"osx_image"`
	Dist     string `json:"dist"`
	Group    string `json:"group"`
	OS       string `json:"os"`
}

StartAttributes contains some parts of the config which can be used to determine the type of instance to boot up (for example, what image to use)

Jump to

Keyboard shortcuts

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