runner

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 11 Imported by: 0

README

Runner

Ref

Documentation

Overview

Package runner run shell command or docker defined in Task But driver (executor) does not know if this a long running command, it's defined in the task

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KillProcessGroup

func KillProcessGroup(process *os.Process) error

KillProcessGroup is copied gitlab-runner helpers process_group_unix man 2 kill

func SetProcessGroup

func SetProcessGroup(attr *syscall.SysProcAttr) *syscall.SysProcAttr

SetProcessGroup is copied from gitlab-runner helpers process_group_unix without calling this KillProcessGroup won't work TODO: I guess it allows you to kill all the child processes of a processes?

Types

type Docker

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

func NewDocker

func NewDocker(s pb.DockerSpec, c *client.Client) (*Docker, error)

func (*Docker) Pull

func (d *Docker) Pull(ctx context.Context) error

func (*Docker) Run

func (d *Docker) Run(ctx context.Context) error

func (*Docker) Start

func (d *Docker) Start(ctx context.Context) error

Start starts the container in background, like docker run -d

type Driver

type Driver interface {
	Run(ctx context.Context) error
}

type Exec

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

func NewExec

func NewExec(s pb.ExecSpec) *Exec

NewExec use os.Stdout and os.Stderr as default redirect TODO: should return error and creates the cmd here, for shell, split shell quote is also needed

func (*Exec) Run

func (e *Exec) Run(ctx context.Context) error

Run wait for the command to finish or kill the process group when context is canceled

type Shell

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

Jump to

Keyboard shortcuts

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