Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdWrapper ¶
type CmdWrapper struct {
// contains filtered or unexported fields
}
func NewCmdWrapper ¶
func NewCmdWrapper(command []string, cwd string, env []string) *CmdWrapper
func (*CmdWrapper) CombinedOutputPipe ¶
func (cw *CmdWrapper) CombinedOutputPipe() (io.ReadCloser, io.WriteCloser)
func (*CmdWrapper) Run ¶
func (cw *CmdWrapper) Run(captureOutput bool, clientLog *Log) (*CommandResult, error)
func (*CmdWrapper) StdinPipe ¶
func (cw *CmdWrapper) StdinPipe() (io.WriteCloser, error)
type CommandResult ¶
type Config ¶
type Config struct { Server string JobstepID string ArtifactSearchPath string UpstreamMonitor bool Snapshot struct { ID string } Source struct { Revision struct { Sha string } Patch struct { ID string } } Repository struct { URL string Backend struct { ID string } } Project struct { Name string Slug string } Cmds []ConfigCmd `json:"commands"` ExpectedSnapshot struct { // If this build is expected to generate a snapshot, this is the snapshot ID. ID string } ResourceLimits ResourceLimits DebugConfig map[string]*json.RawMessage `json:"debugConfig"` }
func LoadConfig ¶
func (*Config) GetDebugConfig ¶
GetDebugConfig parses the debug config JSON at the given key to dest, returning whether the key was present, and if it was, any error that occurred in trying to parse it to dest.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (*Log) Drain ¶
func (l *Log) Drain()
Repeatedly calls GetChunk() until Close is called. Mostly useful for tests.
func (*Log) Printf ¶
Printf calls l.Writeln to print to the log. Arguments are handled in the manner of fmt.Printf. The output is guaranteed to be newline-terminated.
func (*Log) WriteStream ¶
type Metrics ¶
type for recording metrics we might want to report (e.g. to Changes)
func (Metrics) SetDuration ¶
set the duration for the given key
func (Metrics) SetDurationSince ¶
calculate duration since `start` and use that as duration for given key
func (Metrics) StartTimer ¶
create and return a timer starting now
type ResourceLimits ¶
type ResourceLimits struct { // Number of CPUs. Cpus *int // Memory limit in megabytes. Memory *int }
ResourceLimits describes all specified limits that should be applied while executing the JobStep.