buildkite-agent bootstrap
bootstrap is the command the agent executes when it comes to run a job on
your agent.
Running the bootstrap
Usage
buildkite-agent bootstrap [options...]
Description
The bootstrap command executes a Buildkite job locally.
Generally the bootstrap command is run as a sub-process of the buildkite-agent to execute a given job sent from buildkite.com, but you can also invoke the bootstrap manually.
Execution is broken down into phases. By default, the bootstrap runs a plugin phase which sets up any plugins specified, then a checkout phase which pulls down your code and then a command phase that executes the specified command in the created environment.
You can run only specific phases with the --phases flag.
The bootstrap is also responsible for executing hooks around the phases. See https://buildkite.com/docs/agent/hooks for more details.
Example
$ eval $(curl -s -H "Authorization: Bearer xxx" \
"https://api.buildkite.com/v2/organizations/[org]/pipelines/[proj]/builds/[build]/jobs/[job]/env.txt" | \
sed 's/^/export /' \
)
$ buildkite-agent bootstrap --build-path builds
Options
--command string #
|
The command to run |
|---|---|
--job string #
|
The ID of the job being run |
--repository string #
|
The repository to clone and run the job from |
--commit string #
|
The commit to checkout in the repository |
--branch string #
|
The branch the commit is in |
--tag string #
|
The tag the commit |
--refspec string #
|
Optional refspec to override git fetch |
--plugins string #
|
The plugins for the job |
--secrets string #
|
Secrets to be loaded into the job environment |
--pullrequest string #
|
The number/id of the pull request this commit belonged to |
--pull-request-head-commit string #
|
The expected head commit for a pull request build |
--pull-request-using-merge-refspec #
|
Whether the agent should attempt to checkout the pull request commit using the merge refspec. This feature is in private preview and requires backend enablement—contact support to enable (default: false) |
--agent string #
|
The name of the agent running the job |
--queue string #
|
The name of the queue the agent belongs to, if tagged |
--organization string #
|
The slug of the organization that the job is a part of |
--pipeline string #
|
The slug of the pipeline that the job is a part of |
--pipeline-provider string #
|
The id of the SCM provider that the repository is hosted on |
--artifact-upload-paths string #
|
Paths to files to automatically upload at the end of a job |
--artifact-upload-destination string #
|
A custom location to upload artifact paths to (for example, s3://my-custom-bucket/and/prefix) |
--clean-checkout #
|
Whether or not the bootstrap should remove the existing repository before running the command (default: false) |
--skip-checkout #
|
Skip the git checkout phase entirely |
--checkout-override-mode string #
|
Controls which sources may override the agent's checkout settings; one of [strict from-job none]. |
--git-checkout-flags string #
|
Flags to pass to "git checkout" command (default: "-f") |
--git-clone-flags string #
|
Flags to pass to "git clone" command (default: "-v") |
--git-clone-mirror-flags string #
|
Flags to pass to "git clone" command when mirroring (default: "-v") |
--git-clean-flags string #
|
Flags to pass to "git clean" command (default: "-ffxdq") |
--git-commit-verification string #
|
Verify that the commit being built exists on the specified branch; one of strict or off (default: "strict") |
--git-fetch-flags string #
|
Flags to pass to "git fetch" command (default: "-v --prune") |
--git-sparse-checkout-paths string #
|
Comma-separated list of paths for git sparse checkout. When set, only the listed paths are materialized in the working tree. Paths are interpreted according to --git-sparse-checkout-mode. |
--git-sparse-checkout-mode string #
|
Changes how the sparse checkout paths are interpreted; available modes are [cone no-cone]. |
--git-ssh-key string #
|
SSH private key to use for git checkout |
--git-remote-mirror-url string #
|
Backend-provided remote Git mirror used as an optional checkout source |
--git-mirrors-path string #
|
Path to where mirrors of git repositories are stored |
--git-mirror-checkout-mode string #
|
Changes how clones of a mirror are made; available modes are [dissociate reference]. In |
--git-mirrors-lock-timeout int #
|
Seconds to lock a git mirror during clone, should exceed your longest checkout (default: 300) |
--git-mirrors-skip-update #
|
Skip updating the Git mirror (default: false) |
--git-mirrors-lfs-cache #
|
Cache Git LFS objects in the Git mirror when Git LFS is enabled for the checkout. The job's LFS objects are fetched into the mirror while its update lock is held, and each checkout reuses them instead of downloading from the LFS server again. Opt-in because it grows the mirror on disk without pruning, extends the time the mirror lock is held, and may not be faster than downloading from the LFS server when the mirror is on a slow or shared network volume. Requires --git-mirrors-path (default: false) |
--git-submodule-clone-config string #
|
Comma separated key=value git config pairs applied before git submodule clone commands such as |
--git-checkout-timeout int #
|
Seconds to allow for each git checkout attempt before it is killed and retried (0 means no timeout) (default: 0) |
--git-skip-fetch-existing-commits #
|
Skip git fetch if the commit already exists in the local git directory (default: false) |
--git-fetch-base-branch string #
|
Also fetch the base branch during checkout, so every command in the job can diff against its current tip; one of [strict optimistic off]. |
--checkout-attempts int #
|
Number of checkout attempts (including the initial attempt). Failed attempts are retried with exponential backoff (factor of 2, starting at 1s: 1s, 2s, 4s, ...) (default: 6) |
--bin-path string #
|
Directory where the buildkite-agent binary lives |
--build-path string #
|
Path to where the builds will run from |
--hooks-path string #
|
Directory where the hook scripts are found |
--additional-hooks-paths string #
|
Additional directories to look for agent hooks |
--sockets-path string #
|
Directory where the agent will place sockets (default: "$HOME/.buildkite-agent/sockets") |
--plugins-path string #
|
Directory where the plugins are saved to |
--command-eval #
|
Allow running of arbitrary commands (default: true) |
--plugins-enabled #
|
Allow plugins to be run (default: true) |
--plugin-validation #
|
Validate plugin configuration (default: false) |
--plugins-always-clone-fresh #
|
Always make a new clone of plugin source, even if already present (default: false) |
--local-hooks-enabled #
|
Allow local hooks to be run (default: true) |
--ssh-keyscan #
|
Accept new SSH host keys for the default checkout instead of requiring known hosts (default: true) |
--git-submodules #
|
Enable git submodules (default: true) |
--git-lfs-enabled #
|
Enable Git LFS object download during checkout (default: false) |
--pty #
|
Run jobs within a pseudo terminal (default: true) |
--shell string #
|
The shell to use to interpret build commands (default: "/bin/bash -e -c") |
--hooks-shell string #
|
The shell to use to interpret hooks commands |
--phases string #
|
The specific phases to execute. The order they're defined is irrelevant. |
--opentelemetry-tracing #
|
Enable tracing for build jobs with OpenTelemetry OTLP. Configure OTLP with standard OTEL_EXPORTER_OTLP_* env vars (default: false) |
--telemetry-service-name string #
|
Service name to use when reporting traces. (default: "buildkite-agent") |
--tracing-traceparent string #
|
W3C Trace Parent for tracing |
--tracing-tracestate string #
|
W3C Trace State for tracing |
--no-job-api #
|
Disables the Job API, which gives commands in jobs some abilities to introspect and mutate the state of the job (default: false) |
--job-logs-otlp #
|
Export job logs directly as OpenTelemetry log records using the OTEL_EXPORTER_OTLP_LOGS_* / OTEL_EXPORTER_OTLP_* environment configuration (default: false) |
--disable-warnings-for string #
|
A list of warning IDs to disable |
--cancel-signal string #
|
The signal to use for cancellation (default: "SIGTERM") |
--cancel-signal-timeout duration #
|
The amount of time given to a subprocess to handle the cancel signal before SIGKILL is sent (default: 10s) |
--cancel-cleanup-timeout duration #
|
Extra time for a stopping agent to upload logs and artifacts after a job process exits or is killed, before the agent forcefully exits (default: 5s) |
--debug #
|
Enable debug mode. Synonym for |
--log-level string #
|
Set the log level for the agent, making logging more or less verbose. Defaults to notice. Allowed values are: debug, info, error, warn, fatal (default: "notice") |
--experiment string #
|
Enable experimental features within the buildkite-agent |
--profile string #
|
Enable a profiling mode, either cpu, memory, mutex or block |
--redacted-vars string #
|
Pattern of environment variable names containing sensitive values (default: "*_PASSWORD", "*_SECRET", "*_TOKEN", "*_PRIVATE_KEY", "*_SSH_KEY", "*_ACCESS_KEY", "*_SECRET_KEY", "*_CONNECTION_STRING", "*_API_KEY") |
--strict-single-hooks #
|
Enforces that only one checkout hook, and only one command hook, can be run (default: false) |