Documentation
      ¶
    
    
  
    
      Index ¶
- Variables
 - func BoundedCommands(commands []*api.Command, fromName, toName string) []*api.Command
 - func CloneRepository(ctx context.Context, logUploader io.Writer, env *environment.Environment) bool
 - func ConvertAnnotations(annotations []model.Annotation) []*api.Annotation
 - func DeduplicatePaths(paths []string) (result []string)
 - func EnsureFolderExists(path string)
 - func EnvMapAsSlice(env map[string]string) []string
 - func FetchCache(ctx context.Context, logUploader *LogUploader, commandName string, ...) (*os.File, time.Duration, error)
 - func InitializeLogSaveClient(ctx context.Context, taskIdentification *api.TaskIdentification, ...) (api.CirrusCIService_SaveLogsClient, error)
 - func InitializeLogStreamClient(ctx context.Context, taskIdentification *api.TaskIdentification, ...) (api.CirrusCIService_StreamLogsClient, error)
 - func ShellCommandsAndWait(ctx context.Context, scripts []string, custom_env *environment.Environment, ...) (*exec.Cmd, error)
 - func TempFileName(prefix, suffix string) (*os.File, error)
 - func UploadCacheFile(ctx context.Context, cacheURL string, cacheFile *os.File) error
 - type ArtifactUploader
 - type Artifacts
 - type Cache
 - type CacheAttempts
 - func (ca *CacheAttempts) Failed(key string, error string)
 - func (ca *CacheAttempts) Hit(key string, size uint64, downloadedIn, extractedIn time.Duration)
 - func (ca *CacheAttempts) Miss(key string, size uint64, archivedIn, uploadedIn time.Duration)
 - func (ca *CacheAttempts) PopulatedIn(key string, populatedIn time.Duration)
 - func (ca *CacheAttempts) ToProto() map[string]*api.CacheRetrievalAttempt
 
- type CommandAndLogs
 - type Executor
 - func (executor *Executor) CreateFile(ctx context.Context, logUploader *LogUploader, ...) bool
 - func (executor *Executor) DownloadCache(ctx context.Context, logUploader *LogUploader, commandName string, ...) bool
 - func (executor *Executor) ExecuteScriptsAndStreamLogs(ctx context.Context, logUploader *LogUploader, scripts []string, ...) (*exec.Cmd, error)
 - func (executor *Executor) ExecuteScriptsStreamLogsAndWait(ctx context.Context, logUploader *LogUploader, commandName string, ...) (*exec.Cmd, error)
 - func (executor *Executor) RunBuild(ctx context.Context)
 - func (executor *Executor) UploadArtifacts(ctx context.Context, logUploader *LogUploader, name string, ...) bool
 - func (executor *Executor) UploadCache(ctx context.Context, logUploader *LogUploader, commandName string, ...) bool
 
- type GRPCUploader
 - type HTTPSUploader
 - type InstantiateArtifactUploaderFunc
 - type LogUploader
 - func (uploader *LogUploader) Finalize()
 - func (uploader *LogUploader) ReadAvailableChunks() ([]byte, bool)
 - func (uploader *LogUploader) StreamLogs()
 - func (uploader *LogUploader) UploadStoredOutput(ctx context.Context) error
 - func (uploader *LogUploader) WithTimestamps(input []byte) []byte
 - func (uploader *LogUploader) Write(bytes []byte) (int, error)
 - func (uploader *LogUploader) WriteChunk(bytesToWrite []byte) (int, error)
 
- type ProcessedPath
 - type ProcessedPattern
 - type ShellCommands
 - type ShellOutputHandler
 - type ShellOutputWriter
 - type StepResult
 - type UploadDescriptor
 
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var ( ErrStepExit = errors.New("executor step requested to terminate execution") ErrTimedOut = errors.New("timed out") )
      View Source
      
  
var ErrArtifactsPathOutsideWorkingDir = errors.New("path is outside of CIRRUS_WORKING_DIR")
    Functions ¶
func BoundedCommands ¶
BoundedCommands bounds a slice of commands with unique names to a half-open range [fromName, toName).
func CloneRepository ¶
func CloneRepository( ctx context.Context, logUploader io.Writer, env *environment.Environment, ) bool
func ConvertAnnotations ¶
func ConvertAnnotations(annotations []model.Annotation) []*api.Annotation
func DeduplicatePaths ¶
func EnsureFolderExists ¶
func EnsureFolderExists(path string)
func EnvMapAsSlice ¶
func FetchCache ¶
func InitializeLogSaveClient ¶
func InitializeLogSaveClient( ctx context.Context, taskIdentification *api.TaskIdentification, commandName string, raw bool, ) (api.CirrusCIService_SaveLogsClient, error)
func InitializeLogStreamClient ¶
func InitializeLogStreamClient(ctx context.Context, taskIdentification *api.TaskIdentification, commandName string, raw bool) (api.CirrusCIService_StreamLogsClient, error)
func ShellCommandsAndWait ¶
func ShellCommandsAndWait( ctx context.Context, scripts []string, custom_env *environment.Environment, handler ShellOutputHandler, shouldKillProcesses bool, ) (*exec.Cmd, error)
return true if executed successful
Types ¶
type ArtifactUploader ¶
type ArtifactUploader interface {
	Upload(ctx context.Context, artifact io.Reader, relativeArtifactPath string, size int64) error
	Finish(ctx context.Context) error
}
    func NewGRPCUploader ¶
func NewGRPCUploader( ctx context.Context, taskIdentification *api.TaskIdentification, artifacts *Artifacts, ) (ArtifactUploader, error)
func NewHTTPSUploader ¶
func NewHTTPSUploader( ctx context.Context, taskIdentification *api.TaskIdentification, artifacts *Artifacts, ) (ArtifactUploader, error)
type Artifacts ¶
type Artifacts struct {
	Name   string
	Type   string
	Format string
	// contains filtered or unexported fields
}
    func NewArtifacts ¶
func NewArtifacts( name string, artifactsInstruction *api.ArtifactsInstruction, customEnv *environment.Environment, ) (*Artifacts, error)
func (*Artifacts) UploadableFiles ¶
func (artifacts *Artifacts) UploadableFiles() []*api.ArtifactFileInfo
type Cache ¶
type CacheAttempts ¶
type CacheAttempts struct {
	// contains filtered or unexported fields
}
    func NewCacheAttempts ¶
func NewCacheAttempts() *CacheAttempts
func (*CacheAttempts) Failed ¶
func (ca *CacheAttempts) Failed(key string, error string)
func (*CacheAttempts) Hit ¶
func (ca *CacheAttempts) Hit(key string, size uint64, downloadedIn, extractedIn time.Duration)
func (*CacheAttempts) Miss ¶
func (ca *CacheAttempts) Miss(key string, size uint64, archivedIn, uploadedIn time.Duration)
func (*CacheAttempts) PopulatedIn ¶
func (ca *CacheAttempts) PopulatedIn(key string, populatedIn time.Duration)
func (*CacheAttempts) ToProto ¶
func (ca *CacheAttempts) ToProto() map[string]*api.CacheRetrievalAttempt
type CommandAndLogs ¶
type CommandAndLogs struct {
	Name string
	Cmd  *exec.Cmd
	Logs *LogUploader
}
    type Executor ¶
type Executor struct {
	// contains filtered or unexported fields
}
    func NewExecutor ¶
func (*Executor) CreateFile ¶
func (executor *Executor) CreateFile( ctx context.Context, logUploader *LogUploader, instruction *api.FileInstruction, env *environment.Environment, ) bool
func (*Executor) DownloadCache ¶
func (executor *Executor) DownloadCache( ctx context.Context, logUploader *LogUploader, commandName string, cacheHost string, instruction *api.CacheInstruction, custom_env *environment.Environment, ) bool
func (*Executor) ExecuteScriptsAndStreamLogs ¶
func (executor *Executor) ExecuteScriptsAndStreamLogs( ctx context.Context, logUploader *LogUploader, scripts []string, env *environment.Environment, ) (*exec.Cmd, error)
func (*Executor) ExecuteScriptsStreamLogsAndWait ¶
func (executor *Executor) ExecuteScriptsStreamLogsAndWait( ctx context.Context, logUploader *LogUploader, commandName string, scripts []string, env *environment.Environment) (*exec.Cmd, error)
func (*Executor) UploadArtifacts ¶
func (executor *Executor) UploadArtifacts( ctx context.Context, logUploader *LogUploader, name string, artifactsInstruction *api.ArtifactsInstruction, customEnv *environment.Environment, ) bool
func (*Executor) UploadCache ¶
func (executor *Executor) UploadCache( ctx context.Context, logUploader *LogUploader, commandName string, cacheHost string, instruction *api.UploadCacheInstruction, ) bool
type GRPCUploader ¶
type GRPCUploader struct {
	// contains filtered or unexported fields
}
    type HTTPSUploader ¶
type HTTPSUploader struct {
	// contains filtered or unexported fields
}
    type InstantiateArtifactUploaderFunc ¶
type InstantiateArtifactUploaderFunc func( ctx context.Context, taskIdentification *api.TaskIdentification, artifacts *Artifacts, ) (ArtifactUploader, error)
type LogUploader ¶
type LogUploader struct {
	// Fields related to the CIRRUS_LOG_TIMESTAMP behavioral environment variable
	LogTimestamps bool
	GetTimestamp  func() time.Time
	OweTimestamp  bool
	// contains filtered or unexported fields
}
    func NewLogUploader ¶
func (*LogUploader) Finalize ¶
func (uploader *LogUploader) Finalize()
func (*LogUploader) ReadAvailableChunks ¶
func (uploader *LogUploader) ReadAvailableChunks() ([]byte, bool)
func (*LogUploader) StreamLogs ¶
func (uploader *LogUploader) StreamLogs()
func (*LogUploader) UploadStoredOutput ¶
func (uploader *LogUploader) UploadStoredOutput(ctx context.Context) error
func (*LogUploader) WithTimestamps ¶
func (uploader *LogUploader) WithTimestamps(input []byte) []byte
func (*LogUploader) WriteChunk ¶
func (uploader *LogUploader) WriteChunk(bytesToWrite []byte) (int, error)
type ProcessedPath ¶
type ProcessedPath struct {
	// contains filtered or unexported fields
}
    type ProcessedPattern ¶
type ProcessedPattern struct {
	Pattern string
	Paths   []*ProcessedPath
}
    type ShellCommands ¶
type ShellCommands struct {
	// contains filtered or unexported fields
}
    func NewShellCommands ¶
func NewShellCommands( ctx context.Context, scripts []string, custom_env *environment.Environment, handler ShellOutputHandler, ) (*ShellCommands, error)
type ShellOutputHandler ¶
type ShellOutputWriter ¶
type StepResult ¶
type UploadDescriptor ¶
type UploadDescriptor struct {
	// contains filtered or unexported fields
}
    
      
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.