build

package
v0.0.0-...-ea498fe Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// STARTED StageType
	STARTED = StageType("started")
	// PROGRESS StageType
	PROGRESS = StageType("progress")
	// ABORTED StageType
	ABORTED = StageType("aborted")
	// FAILURE StageType
	FAILURE = StageType("failure")
	// SUCCESS StageType
	SUCCESS = StageType("success")
)

Variables

View Source
var (
	// ErrNotFound is returned when queried build does not exist
	ErrNotFound = errors.New("Build not found")

	// ErrNilProject is returned when a build is created with no project
	ErrNilProject = errors.New("Project is nil")

	// ErrContainerType is returned when trying to create an unknwon container type
	ErrContainerType = errors.New("Invalid container type")

	// ErrStageType is returned when trying to create an unknwon stage type
	ErrStageType = errors.New("Invalid stage type")

	// ErrStageOrder is returned when stage is added in an invalid order.
	ErrStageOrder = errors.New("Invalid stage order")
)

Functions

This section is empty.

Types

type Build

type Build interface {
	ID() string
	ExecutorType() string
	ProjectID() string
	Script() string
	Completed() bool
	Stages() []Stage
	Created() int64
	AddStage(stage Stage) error
	Output([]byte) error
	Stdout() []byte
}

Build describes a single build

func New

func New(project Buildable) (Build, error)

New creates a new build

func NewWithExecutorType

func NewWithExecutorType(project Buildable, e string) (Build, error)

NewWithExecutorType creates a new build with a custom executor

type Buildable

type Buildable interface {
	ID() string
	Script() string
}

Buildable can be built interface {

type Container

type Container interface {
	Init() error
	Close() error
	Purge() error
	Builds(projectID *string) []string
	Build(ID string) (Build, error)
	New(b Buildable) (Build, error)
	AddStage(buildID string, stage Stage) error
	Output(buildID string, output []byte) error
}

Container is the container for builds

func NewContainer

func NewContainer(desc string) (Container, error)

NewContainer creates a new build container

type Stage

type Stage struct {
	Type      StageType `json:"type"`
	Timestamp int64     `json:"timestamp"`
	Name      string    `json:"name"`
	Data      []byte    `json:"-"`
}

Stage is a build stage

func FailureStage

func FailureStage() Stage

FailureStage creates a build end stage

func StartStage

func StartStage() Stage

StartStage creates a build start stage

func SuccessStage

func SuccessStage() Stage

SuccessStage creates a build end stage

func (Stage) ValidateWithPredecessor

func (s Stage) ValidateWithPredecessor(predecessor *Stage) error

ValidateWithPredecessor validates a stage together with its predecessor

type StageType

type StageType string

StageType is a build stage type

func (StageType) Validate

func (t StageType) Validate() error

Validate returns true for a valid StageType

type State

type State string

State is the state of a build

Jump to

Keyboard shortcuts

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