Documentation ¶
Index ¶
- Constants
- Variables
- func APIClientEnableHTTPDebug()
- func BuildVersion() string
- func Version() string
- func Worker(id int, ls *LogStreamer)
- type APIClient
- type APIProxy
- type AgentConfiguration
- type AgentPool
- type AgentWorker
- func (a *AgentWorker) Connect() error
- func (a AgentWorker) Create() AgentWorker
- func (a *AgentWorker) Disconnect() error
- func (a *AgentWorker) Heartbeat() error
- func (a *AgentWorker) Ping()
- func (a *AgentWorker) Start() error
- func (a *AgentWorker) Stop(graceful bool)
- func (a *AgentWorker) UpdateProcTitle(action string)
- type ArtifactBatchCreator
- type ArtifactDownloader
- type ArtifactSearcher
- type ArtifactUploader
- type Download
- type EC2MetaData
- type EC2Tags
- type FormUploader
- type GCPMetaData
- type GSDownloader
- type GSUploader
- type HeaderTimesStreamer
- type JobRunner
- type LogStreamer
- type LogStreamerChunk
- type PipelineParser
- type Plugin
- type S3Downloader
- type S3Uploader
- type Uploader
Constants ¶
const (
ArtifactPathDelimiter = ";"
)
Variables ¶
var ANSIColorRegex = regexp.MustCompile(`\x1b\[([;\d]+)?[mK]`)
var ArtifactPathVariableRegex = regexp.MustCompile("\\$\\{artifact\\:path\\}")
var HeaderRegex = regexp.MustCompile("^(?:---|\\+\\+\\+|~~~)\\s(.+)?$")
Functions ¶
func APIClientEnableHTTPDebug ¶
func APIClientEnableHTTPDebug()
func BuildVersion ¶
func BuildVersion() string
Types ¶
type APIProxy ¶
type APIProxy struct {
// contains filtered or unexported fields
}
APIProxy provides either a unix socket or a tcp socket listener with a proxy that will authenticate to the Buildkite Agent API
func NewAPIProxy ¶
func (*APIProxy) AccessToken ¶
type AgentConfiguration ¶
type AgentConfiguration struct { ConfigPath string BootstrapScript string BuildPath string HooksPath string PluginsPath string GitCloneFlags string GitCleanFlags string GitSubmodules bool SSHKeyscan bool CommandEval bool PluginsEnabled bool LocalHooksEnabled bool RunInPty bool TimestampLines bool DisconnectAfterJob bool DisconnectAfterJobTimeout int Shell string }
type AgentPool ¶
type AgentPool struct { APIClient *api.Client Token string ConfigFilePath string Name string Priority string Tags []string TagsFromEC2 bool TagsFromEC2Tags bool TagsFromGCP bool WaitForEC2TagsTimeout time.Duration Endpoint string AgentConfiguration *AgentConfiguration // contains filtered or unexported fields }
func (*AgentPool) CreateAgentTemplate ¶
Takes the options passed to the CLI, and creates an api.Agent record that will be sent to the Buildkite Agent API for registration.
func (*AgentPool) RegisterAgent ¶
Takes the agent template and returns a registered agent. The registered agent includes the Access Token used to communicate with the Buildkite Agent API
func (*AgentPool) ShowBanner ¶
func (r *AgentPool) ShowBanner()
Shows the welcome banner and the configuration options used when starting this agent.
type AgentWorker ¶
type AgentWorker struct { // The API Client used when this agent is communicating with the API APIClient *api.Client // The endpoint that should be used when communicating with the API Endpoint string // The registred agent API record Agent *api.Agent // The configuration of the agent from the CLI AgentConfiguration *AgentConfiguration // contains filtered or unexported fields }
func (*AgentWorker) Connect ¶
func (a *AgentWorker) Connect() error
Connects the agent to the Buildkite Agent API, retrying up to 30 times if it fails.
func (AgentWorker) Create ¶
func (a AgentWorker) Create() AgentWorker
Creates the agent worker and initializes it's API Client
func (*AgentWorker) Disconnect ¶
func (a *AgentWorker) Disconnect() error
Disconnects the agent from the Buildkite Agent API, doesn't bother retrying because we want to disconnect as fast as possible.
func (*AgentWorker) Ping ¶
func (a *AgentWorker) Ping()
Performs a ping, which returns what action the agent should take next.
func (*AgentWorker) Stop ¶
func (a *AgentWorker) Stop(graceful bool)
Stops the agent from accepting new work and cancels any current work it's running
func (*AgentWorker) UpdateProcTitle ¶
func (a *AgentWorker) UpdateProcTitle(action string)
type ArtifactBatchCreator ¶
type ArtifactBatchCreator struct { // The APIClient that will be used when uploading jobs APIClient *api.Client // The ID of the Job that these artifacts belong to JobID string // All the artifacts that need to be created Artifacts []*api.Artifact // Where the artifacts are being uploaded to on the command line UploadDestination string }
type ArtifactDownloader ¶
type ArtifactDownloader struct { // The APIClient that will be used when uploading jobs APIClient *api.Client // The ID of the Build BuildID string // The query used to find the artifacts Query string // Which step should we look at for the jobs Step string // Where we'll be downloading artifacts to Destination string }
func (*ArtifactDownloader) Download ¶
func (a *ArtifactDownloader) Download() error
type ArtifactSearcher ¶
type ArtifactUploader ¶
type ArtifactUploader struct { // The APIClient that will be used when uploading jobs APIClient *api.Client // The ID of the Job JobID string // The path of the uploads Paths string // Where we'll be uploading artifacts Destination string }
func (*ArtifactUploader) Collect ¶
func (a *ArtifactUploader) Collect() (artifacts []*api.Artifact, err error)
func (*ArtifactUploader) Upload ¶
func (a *ArtifactUploader) Upload() error
type Download ¶
type Download struct { // The HTTP client to use for downloading Client http.Client // The actual URL to get the file from URL string // The root directory of the download Destination string // The relative path that should be preserved in the download folder Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool }
type EC2MetaData ¶
type EC2MetaData struct { }
type FormUploader ¶
type FormUploader struct { // Whether or not HTTP calls shoud be debugged DebugHTTP bool }
type GCPMetaData ¶
type GCPMetaData struct { }
type GSDownloader ¶
type GSDownloader struct { // The name of the bucket Bucket string // The root directory of the download Destination string // The relative path that should be preserved in the download folder, // also it's location in the bucket Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool }
func (GSDownloader) BucketFileLocation ¶
func (d GSDownloader) BucketFileLocation() string
func (GSDownloader) BucketName ¶
func (d GSDownloader) BucketName() string
func (GSDownloader) BucketPath ¶
func (d GSDownloader) BucketPath() string
func (GSDownloader) Start ¶
func (d GSDownloader) Start() error
type GSUploader ¶
type GSUploader struct { // The destination which includes the GS bucket name and the path. // gs://my-bucket-name/foo/bar Destination string // Whether or not HTTP calls shoud be debugged DebugHTTP bool // The GS service Service *storage.Service }
func (*GSUploader) BucketName ¶
func (u *GSUploader) BucketName() string
func (*GSUploader) BucketPath ¶
func (u *GSUploader) BucketPath() string
type HeaderTimesStreamer ¶
type HeaderTimesStreamer struct { // The callback that will be called when a header time is ready for // upload UploadCallback func(int, int, map[string]string) // contains filtered or unexported fields }
func (*HeaderTimesStreamer) LineIsHeader ¶
func (h *HeaderTimesStreamer) LineIsHeader(line string) bool
func (*HeaderTimesStreamer) LinePreProcessor ¶
func (h *HeaderTimesStreamer) LinePreProcessor(line string) string
func (*HeaderTimesStreamer) Scan ¶
func (h *HeaderTimesStreamer) Scan(line string)
func (*HeaderTimesStreamer) Start ¶
func (h *HeaderTimesStreamer) Start() error
func (*HeaderTimesStreamer) Stop ¶
func (h *HeaderTimesStreamer) Stop()
func (*HeaderTimesStreamer) Upload ¶
func (h *HeaderTimesStreamer) Upload()
type JobRunner ¶
type JobRunner struct { // The job being run Job *api.Job // The APIClient that will be used when updating the job APIClient *api.Client // The APIProxy that will be exposed to the job bootstrap APIProxy *APIProxy // The endpoint that should be used when communicating with the API Endpoint string // The registred agent API record running this job Agent *api.Agent // The configuration of the agent from the CLI AgentConfiguration *AgentConfiguration // contains filtered or unexported fields }
type LogStreamer ¶
type LogStreamer struct { // How many log streamer workers are running at any one time Concurrency int // The maximum size of chunks MaxChunkSizeBytes int // A counter of how many chunks failed to upload ChunksFailedCount int32 // The callback called when a chunk is ready for upload Callback func(chunk *LogStreamerChunk) error // contains filtered or unexported fields }
func (LogStreamer) New ¶
func (ls LogStreamer) New() *LogStreamer
Creates a new instance of the log streamer
func (*LogStreamer) Process ¶
func (ls *LogStreamer) Process(output string) error
Takes the full process output, grabs the portion we don't have, and adds it to the stream queue
func (*LogStreamer) Start ¶
func (ls *LogStreamer) Start() error
Spins up x number of log streamer workers
func (*LogStreamer) Stop ¶
func (ls *LogStreamer) Stop() error
Waits for all the chunks to be uploaded, then shuts down all the workers
type LogStreamerChunk ¶
type PipelineParser ¶
type PipelineParser struct { Env *env.Environment Filename string Pipeline []byte NoInterpolation bool }
func (PipelineParser) Parse ¶
func (p PipelineParser) Parse() (interface{}, error)
type Plugin ¶
type Plugin struct { // Where the plugin can be found (can either be a file system path, or // a git repository) Location string // The version of the plugin that should be running Version string // The clone method Scheme string // Any authentication attached to the repostiory Authentication string // Configuration for the plugin Configuration map[string]interface{} }
func CreatePlugin ¶
func CreatePluginsFromJSON ¶
Given a JSON structure, convert it to an array of plugins
func (*Plugin) ConfigurationToEnvironment ¶
func (p *Plugin) ConfigurationToEnvironment() (*env.Environment, error)
Converts the plugin configuration values to environment variables
func (*Plugin) Identifier ¶
Returns and ID for the plugin that can be used as a folder name
func (*Plugin) Repository ¶
Returns the repository host where the code is stored
func (*Plugin) RepositorySubdirectory ¶
Returns the subdirectory path that the plugin is in
type S3Downloader ¶
type S3Downloader struct { // The S3 bucket name and the path, e.g s3://my-bucket-name/foo/bar Bucket string // The root directory of the download Destination string // The relative path that should be preserved in the download folder, // also it's location in the bucket Path string // How many times should it retry the download before giving up Retries int // If failed responses should be dumped to the log DebugHTTP bool }
func (S3Downloader) BucketFileLocation ¶
func (d S3Downloader) BucketFileLocation() string
func (S3Downloader) BucketName ¶
func (d S3Downloader) BucketName() string
func (S3Downloader) BucketPath ¶
func (d S3Downloader) BucketPath() string
func (S3Downloader) Start ¶
func (d S3Downloader) Start() error
type S3Uploader ¶
type S3Uploader struct { // The destination which includes the S3 bucket name and the path. // e.g s3://my-bucket-name/foo/bar Destination string // Whether or not HTTP calls should be debugged DebugHTTP bool // contains filtered or unexported fields }
func (*S3Uploader) BucketName ¶
func (u *S3Uploader) BucketName() string
func (*S3Uploader) BucketPath ¶
func (u *S3Uploader) BucketPath() string
Source Files ¶
- agent_configuration.go
- agent_pool.go
- agent_worker.go
- api_client.go
- api_proxy.go
- artifact_batch_creator.go
- artifact_downloader.go
- artifact_searcher.go
- artifact_uploader.go
- aws.go
- download.go
- ec2_meta_data.go
- ec2_tags.go
- form_uploader.go
- gcp_meta_data.go
- gs_downloader.go
- gs_uploader.go
- header_times_streamer.go
- job_runner.go
- log_streamer.go
- pipeline_parser.go
- plugin.go
- s3.go
- s3_downloader.go
- s3_uploader.go
- uploader.go
- version.go