lifecycle

package
v0.0.0-...-55fbde6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(conf *config.Config, queue *Queue, running *Running, manager manager.Driver) error

Check checks the running queue for an available spot for the next entry from the waiting queue

Types

type Queue

type Queue struct {
	Queue []*QueueEntry
	// contains filtered or unexported fields
}

Queue is the qaiting queue

func NewQueue

func NewQueue(store datastore.Datastore) *Queue

NewQueue returns a pointer to an instanc of a queue

func (*Queue) Add

func (q *Queue) Add(proj, branch, prevCommit, currCommit string)

Add adds a project to the queue

func (*Queue) GetLastSuccess

func (q *Queue) GetLastSuccess(proj, branch string) (string, error)

GetLastSuccess fetches the commit hash of the last successful build

func (*Queue) Pop

func (q *Queue) Pop(r *Running, maxBuilds int) *QueueEntry

Pop pops the index 0 of the queue if it can run

func (*Queue) SaveLastSuccess

func (q *Queue) SaveLastSuccess(proj, branch, last string) error

SaveLastSuccess saves the commits of the last successful build on a branch of a project

func (*Queue) SnapShot

func (q *Queue) SnapShot() error

SnapShot saves the queue's current state

type QueueEntry

type QueueEntry struct {
	Project    string
	Branch     string
	PrevCommit string
	CurrCommit string
	CreatedAt  time.Time
	FinishedAt time.Time
	Status     string
}

QueueEntry is an entry in the waiting and running queue

type Running

type Running struct {
	Builds    []*QueueEntry
	Alive     map[aliveKey]*QueueEntry
	KeepAlive map[aliveKey]bool
}

Running is the running queue

func (*Running) CheckIn

func (r *Running) CheckIn(project, branch string)

CheckIn changes whether a build is alive or not

func (*Running) Watch

func (r *Running) Watch(manager *manager.Driver)

Watch watches running maestro builds

Jump to

Keyboard shortcuts

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