runner

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: MPL-2.0-no-copyleft-exception Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	Logger      *log.SubLogger
	QueueItem   *model.QueueItem
	Config      *config.Config
	ContainerID string
	Status      bool
	Context     context.Context
	Cancel      context.CancelFunc
	Docker      *client.Client
}

Run is the encapsulation of a CI run.

func NewRun

func NewRun(context context.Context, cancelFunc context.CancelFunc, qi *model.QueueItem, c *config.Config, logger *log.SubLogger, client *client.Client) (*Run, error)

NewRun constructs a new *Run.

func (*Run) MountCleanup

func (r *Run) MountCleanup(m *overlay.Mount) error

MountCleanup cleans up the mount and any dirs created.

func (*Run) MountRepo

func (r *Run) MountRepo(gr *git.RepoManager) (*overlay.Mount, error)

MountRepo mounts the repo through overlayfs so we can quickly clean up the build artifacts and other work done in the container.

func (*Run) PullRepo

func (r *Run) PullRepo(w io.Writer) (*git.RepoManager, error)

PullRepo retrieves the repository and puts it in the right spot.

func (*Run) RunDocker

func (r *Run) RunDocker() error

RunDocker runs the queue item in docker, pulling any necessary content to do so.

func (*Run) StartCancelFunc

func (r *Run) StartCancelFunc()

StartCancelFunc launches a goroutine which waits for the cancel signal. Terminates when the run ends; one way or another. This function does not block.

func (*Run) StartLogger

func (r *Run) StartLogger(rc io.Reader)

StartLogger starts a goroutine that writes data produced on the reader to the log.

type Runner

type Runner struct {
	Config     *config.Config
	CurrentRun *Run
	Docker     *client.Client
}

Runner encapsulates an infinite lifecycle overlay-runner.

func (*Runner) BeforeRun

func (r *Runner) BeforeRun(ctx *fwcontext.RunContext) error

BeforeRun is executed before the next run is started.

func (*Runner) Hostname

func (r *Runner) Hostname() string

Hostname is the reported hostname of the machine; an identifier. Not necessary for anything and insecure, just ornamental.

func (*Runner) Init

func (r *Runner) Init(ctx *fwcontext.Context) error

Init is the bootstrap of the runner.

func (*Runner) LogsvcClient

func (r *Runner) LogsvcClient(ctx *fwcontext.RunContext) *log.SubLogger

LogsvcClient returns the system log client. Must be called after configuration is initialized

func (*Runner) QueueClient

func (r *Runner) QueueClient() *queue.Client

QueueClient returns the queue client

func (*Runner) QueueName

func (r *Runner) QueueName() string

QueueName is the name of the queue this runner should be processing.

func (*Runner) Run

func (r *Runner) Run(ctx *fwcontext.RunContext) (bool, error)

Run runs the CI job.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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