Documentation
¶
Index ¶
- type Run
- type Runner
- func (r *Runner) BeforeRun(ctx *fwcontext.RunContext) error
- func (r *Runner) Hostname() string
- func (r *Runner) Init(ctx *fwcontext.Context) error
- func (r *Runner) LogsvcClient(ctx *fwcontext.RunContext) *log.SubLogger
- func (r *Runner) QueueClient() *queue.Client
- func (r *Runner) QueueName() string
- func (r *Runner) Run(ctx *fwcontext.RunContext) (bool, error)
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 ¶
MountCleanup cleans up the mount and any dirs created.
func (*Run) MountRepo ¶
MountRepo mounts the repo through overlayfs so we can quickly clean up the build artifacts and other work done in the container.
func (*Run) RunDocker ¶
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 ¶
StartLogger starts a goroutine that writes data produced on the reader to the log.
type Runner ¶
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 ¶
Hostname is the reported hostname of the machine; an identifier. Not necessary for anything and insecure, just ornamental.
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 ¶
QueueClient returns the queue client