agent

package
v3.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const LinuxSystemBuildPath = "/var/lib/buildkite-agent/builds"

LinuxSystemBuildPath is the build path the Linux packages configure for the buildkite-agent system service.

Variables

This section is empty.

Functions

func BinaryName added in v3.33.0

func BinaryName(targetOS string) string

BinaryName returns the platform-appropriate binary name.

func BuildDownloadURL added in v3.33.0

func BuildDownloadURL(version, os, arch string) string

BuildDownloadURL returns the GitHub releases URL for the given agent version, OS, and arch.

func BuildSHA256SumsURL added in v3.33.0

func BuildSHA256SumsURL(version string) string

BuildSHA256SumsURL returns the URL for the SHA256SUMS file for a given agent version.

func CreateAgentToken added in v3.33.0

func CreateAgentToken(ctx context.Context, f *factory.Factory, org, clusterID, description string) (buildkite.ClusterToken, error)

CreateAgentToken creates an agent token on the given cluster. The returned token's Token field holds the secret value, which the API only returns here.

func DefaultBinDir added in v3.33.0

func DefaultBinDir(targetOS string) string

DefaultBinDir returns the platform-appropriate default directory for the agent binary.

func DefaultBuildPath added in v3.33.0

func DefaultBuildPath(targetOS string) string

DefaultBuildPath returns the platform-appropriate default directory for agent builds.

func DefaultConfigPath added in v3.33.0

func DefaultConfigPath(targetOS string) string

DefaultConfigPath returns the platform-appropriate default path for the agent config file.

func DownloadToTemp added in v3.33.0

func DownloadToTemp(url string) (string, error)

DownloadToTemp downloads the given URL to a temporary file and returns its path. The caller is responsible for removing the file when done.

func ExtractBinary added in v3.33.0

func ExtractBinary(archive, dest, targetOS string) error

ExtractBinary extracts the buildkite-agent binary from the given archive to dest.

func FetchExpectedSHA256 added in v3.33.0

func FetchExpectedSHA256(sumsURL, archiveFilename string) (string, error)

FetchExpectedSHA256 downloads the SHA256SUMS file and returns the expected hash for the given archive filename.

func FindCluster added in v3.33.0

func FindCluster(ctx context.Context, f *factory.Factory, org, clusterID, clusterName string) (string, error)

FindCluster resolves an explicit UUID or exact name, falling back to "Default". UUIDs are passed through without a lookup. Resolution failures list all clusters visible to the caller so they can retry with an explicit selector.

func FindQueue added in v3.68.0

func FindQueue(ctx context.Context, f *factory.Factory, org, clusterID, key string) (string, error)

FindQueue resolves an exact queue key within a cluster, or the cluster's configured default queue when key is empty. Only self-hosted queues can be used by a local agent. Selection errors list the available self-hosted keys.

func IsSystemConfigPath added in v3.67.0

func IsSystemConfigPath(targetOS, configPath string) bool

IsSystemConfigPath reports whether configPath is where the Linux packages' buildkite-agent service reads its config. That service runs as the buildkite-agent user, so it can't use a build path in the invoking user's home.

func ResolveBuildPath added in v3.67.0

func ResolveBuildPath(targetOS, configPath, buildPath string) string

ResolveBuildPath returns buildPath if set, otherwise the default build path to pair with a config written to configPath.

func ResolveLatestVersion added in v3.33.0

func ResolveLatestVersion() (string, error)

ResolveLatestVersion queries the GitHub API for the latest buildkite-agent release tag.

func VerifySHA256 added in v3.33.0

func VerifySHA256(path, expected string) error

VerifySHA256 computes the SHA256 hash of the file at path and compares it to the expected hex-encoded hash. Returns an error if they don't match.

func WriteAgentConfig added in v3.33.0

func WriteAgentConfig(path, token, buildPath string, tags []string) error

WriteAgentConfig writes a minimal agent config file with the given token, build path, and optional tags. The file is created with 0600 permissions.

Types

type ExistingInstall added in v3.33.0

type ExistingInstall struct {
	Path    string
	Version string
}

ExistingInstall describes a buildkite-agent binary already present on the system.

func FindExisting added in v3.33.0

func FindExisting(targetOS string) *ExistingInstall

FindExisting looks for buildkite-agent in PATH and returns info about it. Returns nil if no existing installation is found.

Jump to

Keyboard shortcuts

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