Buildkite Agent configuration
Every agent installer comes with a configuration file. You can also customize many of the configuration values using environment variables.
Example configuration file
token="24db61df8338027652b24aadf82dd483b016eef98fcd332815"
name="my-app-%spawn"
tags="ci=true,docker=true"
git-clean-flags="-ffdqx"
debug=true
You can find the directory location of your configuration file in your platform's installation documentation. You can also set this folder using the --config command line argument or the BUILDKITE_AGENT_CONFIG environment variable.
BUILDKITE_AGENT_CONFIG="/etc/buildkite-agent/custom-config-files-dir" buildkite-agent start
Configuration settings
| Required | |
|---|---|
build-path#
Required
Environment variable:
|
Path to where the builds will run from |
token#
Required
Environment variable:
|
Your account agent token |
| Optional | |
no-color#
Optional
Environment variable:
|
Don't show colors in logging |
debug#
Optional
Environment variable:
|
Enable debug mode. Synonym for ′--log-level debug′. Takes precedence over ′--log-level′ |
log-level#
Optional
Environment variable:
Default value:
|
Set the log level for the agent, making logging more or less verbose. Defaults to notice. Allowed values are: debug, info, error, warn, fatal |
experiment#
Optional
Environment variable:
|
Enable experimental features within the buildkite-agent |
profile#
Optional
Environment variable:
|
Enable a profiling mode, either cpu, memory, mutex or block |
name#
Optional
Environment variable:
|
The name of the agent |
priority#
Optional
Environment variable:
|
The priority of the agent (higher priorities are assigned work first) |
acquire-job#
Optional
Environment variable:
|
Start this agent and only run the specified job, disconnecting after it's finished |
reflect-exit-status#
Optional
Environment variable:
|
When used with --acquire-job, causes the agent to exit with the same exit status as the job |
disconnect-after-job#
Optional
Environment variable:
|
Disconnect the agent after running exactly one job. When used in conjunction with the ′--spawn′ flag, each worker booted will run exactly one job |
disconnect-after-idle-timeout#
Optional
Environment variable:
Default value:
|
The maximum idle time in seconds to wait for a job before disconnecting. The default of 0 means no timeout |
disconnect-after-uptime#
Optional
Environment variable:
Default value:
|
The maximum uptime in seconds before the agent stops accepting new jobs and shuts down after any running jobs complete. The default of 0 means no timeout |
cancel-grace-period#
Optional
Environment variable:
Default value:
|
The number of seconds a canceled or timed out job is given to gracefully terminate and upload its artifacts |
enable-job-log-tmpfile#
Optional
Environment variable:
|
Store the job logs in a temporary file ′BUILDKITE_JOB_LOG_TMPFILE′ that is accessible during the job and removed at the end of the job |
job-log-path#
Optional
Environment variable:
|
Location to store job logs created by configuring ′enable-job-log-tmpfile`, by default job log will be stored in TempDir |
write-job-logs-to-stdout#
Optional
Environment variable:
|
Writes job logs to the agent process' stdout. This simplifies log collection if running agents in Docker. |
shell#
Optional
Environment variable:
Default value:
|
The shell command used to interpret build commands, e.g /bin/bash -e -c |
queue#
Optional
Environment variable:
|
The queue the agent will listen to for jobs. If not set, the agent will use the default queue. Overwrites the queue tag in the agent's tags |
tags#
Optional
Environment variable:
|
A comma-separated list of tags for the agent (for example, "linux" or "mac,xcode=8") |
tags-from-host#
Optional
Environment variable:
|
Include tags from the host (hostname, machine-id, os) |
tags-from-ec2-meta-data#
Optional
Environment variable:
|
Include the default set of host EC2 meta-data as tags (instance-id, instance-type, ami-id, and instance-life-cycle) |
tags-from-ec2-meta-data-paths#
Optional
Environment variable:
|
Include additional tags fetched from EC2 meta-data using tag & path suffix pairs, e.g "tag_name=path/to/value" |
tags-from-ec2-tags#
Optional
Environment variable:
|
Include the host's EC2 tags as tags |
tags-from-ecs-meta-data#
Optional
Environment variable:
|
Include the host's ECS meta-data as tags (container-name, image, and task-arn) |
tags-from-gcp-meta-data#
Optional
Environment variable:
|
Include the default set of host Google Cloud instance meta-data as tags (instance-id, machine-type, preemptible, project-id, region, and zone) |
tags-from-gcp-meta-data-paths#
Optional
Environment variable:
|
Include additional tags fetched from Google Cloud instance meta-data using tag & path suffix pairs, e.g "tag_name=path/to/value" |
tags-from-gcp-labels#
Optional
Environment variable:
|
Include the host's Google Cloud instance labels as tags |
wait-for-ec2-tags-timeout#
Optional
Environment variable:
Default value:
|
The amount of time to wait for tags from EC2 before proceeding |
wait-for-ec2-meta-data-timeout#
Optional
Environment variable:
Default value:
|
The amount of time to wait for meta-data from EC2 before proceeding |
wait-for-ecs-meta-data-timeout#
Optional
Environment variable:
Default value:
|
The amount of time to wait for meta-data from ECS before proceeding |
wait-for-gcp-labels-timeout#
Optional
Environment variable:
Default value:
|
The amount of time to wait for labels from GCP before proceeding |
git-checkout-flags#
Optional
Environment variable:
Default value:
|
Flags to pass to "git checkout" command |
git-clone-flags#
Optional
Environment variable:
Default value:
|
Flags to pass to the "git clone" command |
git-clean-flags#
Optional
Environment variable:
Default value:
|
Flags to pass to "git clean" command |
git-fetch-flags#
Optional
Environment variable:
Default value:
|
Flags to pass to "git fetch" command |
git-clone-mirror-flags#
Optional
Environment variable:
Default value:
|
Flags to pass to the "git clone" command when used for mirroring |
git-mirrors-path#
Optional
Environment variable:
|
Path to where mirrors of git repositories are stored |
git-mirrors-lock-timeout#
Optional
Environment variable:
Default value:
|
Seconds to lock a git mirror during clone, should exceed your longest checkout |
git-mirrors-skip-update#
Optional
Environment variable:
|
Skip updating the Git mirror |
bootstrap-script#
Optional
Environment variable:
|
The command that is executed for bootstrapping a job, defaults to the bootstrap sub-command of this binary |
hooks-path#
Optional
Environment variable:
|
Directory where the hook scripts are found |
additional-hooks-paths#
Optional
Environment variable:
|
Additional directories to look for agent hooks |
sockets-path#
Optional
Environment variable:
Default value:
|
Directory where the agent will place sockets |
plugins-path#
Optional
Environment variable:
|
Directory where the plugins are saved to |
no-ansi-timestamps#
Optional
Environment variable:
|
Do not insert ANSI timestamp codes at the start of each line of job output |
timestamp-lines#
Optional
Environment variable:
|
Prepend timestamps on each line of job output. Has no effect unless --no-ansi-timestamps is also used |
health-check-addr#
Optional
Environment variable:
|
Start an HTTP server on this addr:port that returns whether the agent is healthy, disabled by default |
no-pty#
Optional
Environment variable:
|
Do not run jobs within a pseudo terminal |
no-ssh-keyscan#
Optional
Environment variable:
|
Don't automatically run ssh-keyscan before checkout |
no-command-eval#
Optional
Environment variable:
|
Don't allow this agent to run arbitrary console commands, including plugins |
no-plugins#
Optional
Environment variable:
|
Don't allow this agent to load plugins |
no-plugin-validation#
Optional
Environment variable:
|
Don't validate plugin configuration and requirements |
plugins-always-clone-fresh#
Optional
Environment variable:
|
Always make a new clone of plugin source, even if already present |
no-local-hooks#
Optional
Environment variable:
|
Don't allow local hooks to be run from checked out repositories |
no-git-submodules#
Optional
Environment variable:
|
Don't automatically checkout git submodules |
no-feature-reporting#
Optional
Environment variable:
|
Disables sending a list of enabled features back to the Buildkite mothership. We use this information to measure feature usage, but if you're not comfortable sharing that information then that's totally okay :) |
allowed-repositories#
Optional
Environment variable:
|
A comma-separated list of regular expressions representing repositories the agent is allowed to clone (for example, "^git@github.com:buildkite/." or "^https://github.com/buildkite/.") |
enable-environment-variable-allowlist#
Optional
Environment variable:
|
Only run jobs where all environment variables are allowed by the allowed-environment-variables option, or have been set by Buildkite |
allowed-environment-variables#
Optional
Environment variable:
|
A comma-separated list of regular expressions representing environment variables the agent will pass to jobs (for example, "^MYAPP_.*$"). Environment variables set by Buildkite will always be allowed. Requires --enable-environment-variable-allowlist to be set |
allowed-plugins#
Optional
Environment variable:
|
A comma-separated list of regular expressions representing plugins the agent is allowed to use (for example, "^buildkite-plugins/.$" or "^/var/lib/buildkite-plugins/.") |
metrics-datadog#
Optional
Environment variable:
|
Send metrics to DogStatsD for Datadog |
metrics-datadog-host#
Optional
Environment variable:
Default value:
|
The dogstatsd instance to send metrics to using udp |
metrics-datadog-distributions#
Optional
Environment variable:
|
Use Datadog Distributions for Timing metrics |
log-format#
Optional
Environment variable:
Default value:
|
The format to use for the logger output |
spawn#
Optional
Environment variable:
Default value:
|
The number of agents to spawn in parallel (mutually exclusive with --spawn-per-cpu) |
spawn-per-cpu#
Optional
Environment variable:
Default value:
|
The number of agents to spawn per cpu in parallel (mutually exclusive with --spawn) |
spawn-with-priority#
Optional
Environment variable:
|
Assign priorities to every spawned agent (when using --spawn or --spawn-per-cpu) equal to the agent's index |
cancel-signal#
Optional
Environment variable:
Default value:
|
The signal to use for cancellation |
signal-grace-period-seconds#
Optional
Environment variable:
Default value:
|
The number of seconds given to a subprocess to handle being sent ′cancel-signal′. After this period has elapsed, SIGKILL will be sent. Negative values are taken relative to ′cancel-grace-period′. The default value (-1) means that the effective signal grace period is equal to ′cancel-grace-period′ minus 1. |
tracing-backend#
Optional
Environment variable:
|
Enable tracing for build jobs by specifying a backend, "datadog" or "opentelemetry" |
tracing-propagate-traceparent#
Optional
Environment variable:
|
Enable accepting traceparent context from Buildkite control plane (only supported for OpenTelemetry backend) |
tracing-service-name#
Optional
Environment variable:
Default value:
|
Service name to use when reporting traces. |
verification-jwks-file#
Optional
Environment variable:
|
Path to a file containing a JSON Web Key Set (JWKS), used to verify job signatures. |
signing-jwks-file#
Optional
Environment variable:
|
Path to a file containing a signing key. Passing this flag enables pipeline signing for all pipelines uploaded by this agent. For hmac-sha256, the raw file content is used as the shared key. When using Docker containers to upload pipeline steps dynamically, use environment variable propagation (for example, "docker run -e BUILDKITE_AGENT_JWKS_FILE") to allow all steps within the pipeline to be signed. |
signing-jwks-key-id#
Optional
Environment variable:
|
The JWKS key ID to use when signing the pipeline. If omitted, and the signing JWKS contains only one key, that key will be used. |
signing-aws-kms-key#
Optional
Environment variable:
|
The KMS KMS key ID, or key alias used when signing and verifying the pipeline. |
debug-signing#
Optional
Environment variable:
|
Enable debug logging for pipeline signing. This can potentially leak secrets to the logs as it prints each step in full before signing. Requires debug logging to be enabled |
verification-failure-behavior#
Optional
Environment variable:
Default value:
|
The behavior when a job is received without a valid verifiable signature (without a signature, with an invalid signature, or with a signature that fails verification). One of: [block warn]. Defaults to block |
disable-warnings-for#
Optional
Environment variable:
|
A list of warning IDs to disable |
endpoint#
Optional
Environment variable:
Default value:
|
The Agent API endpoint |
no-http2#
Optional
Environment variable:
|
Disable HTTP2 when communicating with the Agent API. |
debug-http#
Optional
Environment variable:
|
Enable HTTP debug mode, which dumps all request and response bodies to the log |
trace-http#
Optional
Environment variable:
|
Enable HTTP trace mode, which logs timings for each HTTP request. Timings are logged at the debug level unless a request fails at the network level in which case they are logged at the error level |
redacted-vars#
Optional
Environment variable:
Default value:
|
Pattern of environment variable names containing sensitive values |
strict-single-hooks#
Optional
Environment variable:
|
Enforces that only one checkout hook, and only one command hook, can be run |
kubernetes-exec#
Optional
Environment variable:
|
This is intended to be used only by the Buildkite k8s stack (github.com/buildkite/agent-stack-k8s); it enables a Unix socket for transporting logs and exit statuses between containers in a pod |
kubernetes-log-collection-grace-period#
Optional
Environment variable:
Default value:
|
How long to wait for Kubernetes processes to complete before stopping log collection during graceful termination. This should be less than the pod's terminationGracePeriodSeconds to allow time for final log upload |
trace-context-encoding#
Optional
Environment variable:
Default value:
|
Sets the inner encoding for BUILDKITE_TRACE_CONTEXT. Must be either json or gob |
no-multipart-artifact-upload#
Optional
Environment variable:
|
For Buildkite-hosted artifacts, disables the use of multipart uploads. Has no effect on uploads to other destinations such as custom cloud buckets |
tags-from-ec2#
Optional
Environment variable:
|
Include the host's EC2 meta-data as tags (instance-id, instance-type, and ami-id) |
tags-from-gcp#
Optional
Environment variable:
|
Include the host's Google Cloud instance meta-data as tags (instance-id, machine-type, preemptible, project-id, region, and zone) |
Deprecated configuration settings
disconnect-after-job-timeout |
When Not to be confused with default and maximum build timeouts. Default: Environment variable: |
|---|---|
meta-data |
Meta data for the agent.
Default: Environment variable: |
meta-data-ec2 |
Include the host's EC2 meta-data (instance-id, instance-type, and ami-id) as meta-data.
Default: Environment variable: |
meta-data-ec2-tags |
Include the host's EC2 tags as meta-data.
Default: Environment variable: |
meta-data-gcp |
Include the host's GCP meta-data as meta-data.
Default: Environment variable: |
no-automatic-ssh-fingerprint-verification |
Do not automatically verify SSH fingerprints for first-time checkouts.
Default: Environment variable: |
Environment variables
Most configuration options can be specified as environment variables when starting the agent, for example:
BUILDKITE_AGENT_TAGS="queue=deploy,host=$(hostname)" buildkite-agent start
These variables cannot be modified through the Buildkite web interface, API or using pipeline upload for security reasons. You may be able to modify some of the options, such as BUILDKITE_GIT_CLONE_FLAGS, from within hooks.
Agent Naming
The following template variables are supported when configuring the agent name:
-
%hostname- the agent machine's hostname -
%spawn- the spawn index number (1, 2, 3, etc.) when launching multiple agents per host -
%random- six (6) random alphanumeric characters [a-zA-Z0-9] -
%pid- the agent's process ID
If you're using --spawn to run multiple agents on a single host, it's recommended to use %spawn in your agent name to ensure that each agent running on the host using the same build-path has a unique agent name.