Documentation ¶
Index ¶
- Variables
- func BoundedCommands(commands []*api.Command, fromName, toName string) []*api.Command
- 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 ExpandText(text string, customEnv map[string]string) string
- func ExpandTextOSFirst(text string, customEnv 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 *map[string]string, ...) (*exec.Cmd, error)
- func TempFileName(prefix, suffix string) (*os.File, error)
- func UploadCacheFile(ctx context.Context, cacheHost string, cacheKey string, cacheFile *os.File) error
- 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) CloneRepository(ctx context.Context, logUploader *LogUploader, env map[string]string) bool
- 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 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 ShellCommands
- type ShellOutputHandler
- type ShellOutputWriter
- type StepResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrArtifactsPathOutsideWorkingDir = errors.New("path is outside of CIRRUS_WORKING_DIR")
View Source
var (
ErrStepExit = errors.New("executor step requested to terminate execution")
)
View Source
var TimeOutError = errors.New("timed out")
Functions ¶
func BoundedCommands ¶ added in v1.6.0
BoundedCommands bounds a slice of commands with unique names to a half-open range [fromName, toName).
func ConvertAnnotations ¶
func ConvertAnnotations(annotations []model.Annotation) []*api.Annotation
func DeduplicatePaths ¶ added in v1.15.0
func EnsureFolderExists ¶
func EnsureFolderExists(path string)
func EnvMapAsSlice ¶ added in v1.68.0
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)
Types ¶
type Cache ¶
type CacheAttempts ¶ added in v1.47.0
type CacheAttempts struct {
// contains filtered or unexported fields
}
func NewCacheAttempts ¶ added in v1.47.0
func NewCacheAttempts() *CacheAttempts
func (*CacheAttempts) Failed ¶ added in v1.47.0
func (ca *CacheAttempts) Failed(key string, error string)
func (*CacheAttempts) Hit ¶ added in v1.47.0
func (ca *CacheAttempts) Hit(key string, size uint64, downloadedIn, extractedIn time.Duration)
func (*CacheAttempts) Miss ¶ added in v1.47.0
func (ca *CacheAttempts) Miss(key string, size uint64, archivedIn, uploadedIn time.Duration)
func (*CacheAttempts) PopulatedIn ¶ added in v1.47.0
func (ca *CacheAttempts) PopulatedIn(key string, populatedIn time.Duration)
func (*CacheAttempts) ToProto ¶ added in v1.47.0
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) CloneRepository ¶
func (*Executor) CreateFile ¶
func (executor *Executor) CreateFile( ctx context.Context, logUploader *LogUploader, instruction *api.FileInstruction, env map[string]string, ) bool
func (*Executor) DownloadCache ¶ added in v1.45.0
func (*Executor) ExecuteScriptsAndStreamLogs ¶
func (*Executor) ExecuteScriptsStreamLogsAndWait ¶
func (*Executor) UploadArtifacts ¶ added in v1.45.0
func (executor *Executor) UploadArtifacts( ctx context.Context, logUploader *LogUploader, name string, artifactsInstruction *api.ArtifactsInstruction, customEnv map[string]string, ) bool
func (*Executor) UploadCache ¶ added in v1.45.0
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 ¶ added in v1.17.0
func (uploader *LogUploader) WithTimestamps(input []byte) []byte
func (*LogUploader) WriteChunk ¶
func (uploader *LogUploader) WriteChunk(bytesToWrite []byte) (int, error)
type ProcessedPath ¶ added in v1.71.0
type ShellCommands ¶
type ShellCommands struct {
// contains filtered or unexported fields
}
func NewShellCommands ¶ added in v1.45.0
func NewShellCommands( ctx context.Context, scripts []string, custom_env *map[string]string, handler ShellOutputHandler, ) (*ShellCommands, error)
type ShellOutputHandler ¶
type ShellOutputWriter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.