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/v3/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 value #
|
The command to run |
---|---|
--job value #
|
The ID of the job being run |
--repository value #
|
The repository to clone and run the job from |
--commit value #
|
The commit to checkout in the repository |
--branch value #
|
The branch the commit is in |
--tag value #
|
The tag the commit |
--refspec value #
|
Optional refspec to override git fetch |
--plugins value #
|
The plugins for the job |
--pullrequest value #
|
The number/id of the pull request this commit belonged to |
--agent value #
|
The name of the agent running the job |
--queue value #
|
The name of the queue the agent belongs to, if tagged |
--organization value #
|
The slug of the organization that the job is a part of |
--pipeline value #
|
The slug of the pipeline that the job is a part of |
--pipeline-provider value #
|
The id of the SCM provider that the repository is hosted on |
--artifact-upload-paths value #
|
Paths to files to automatically upload at the end of a job |
--artifact-upload-destination value #
|
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 |
--git-checkout-flags value #
|
Flags to pass to "git checkout" command (default: "-f") |
--git-clone-flags value #
|
Flags to pass to "git clone" command (default: "-v") |
--git-clone-mirror-flags value #
|
Flags to pass to "git clone" command when mirroring (default: "-v") |
--git-clean-flags value #
|
Flags to pass to "git clean" command (default: "-ffxdq") |
--git-fetch-flags value #
|
Flags to pass to "git fetch" command |
--git-submodule-clone-config value #
|
Comma separated key=value git config pairs applied before git submodule clone commands. For example, `update --init`. If the config is needed to be applied to all git commands, supply it in a global git config file for the system that the agent runs in instead. |
--git-mirrors-path value #
|
Path to where mirrors of git repositories are stored |
--git-mirrors-lock-timeout value #
|
Seconds to lock a git mirror during clone, should exceed your longest checkout (default: 300) |
--git-mirrors-skip-update #
|
Skip updating the Git mirror |
--bin-path value #
|
Directory where the buildkite-agent binary lives |
--build-path value #
|
Directory where builds will be created |
--hooks-path value #
|
Directory where the hook scripts are found |
--sockets-path value #
|
Directory where the agent will place sockets (default: "$HOME/.buildkite-agent/sockets") |
--plugins-path value #
|
Directory where the plugins are saved to |
--command-eval #
|
Allow running of arbitrary commands |
--plugins-enabled #
|
Allow plugins to be run |
--plugin-validation #
|
Validate plugin configuration |
--plugins-always-clone-fresh #
|
Always make a new clone of plugin source, even if already present |
--local-hooks-enabled #
|
Allow local hooks to be run |
--ssh-keyscan #
|
Automatically run ssh-keyscan before checkout |
--git-submodules #
|
Enable git submodules |
--pty #
|
Run jobs within a pseudo terminal |
--shell value #
|
The shell to use to interpret build commands (default: "/bin/bash -e -c") |
--phases value #
|
The specific phases to execute. The order they're defined is irrelevant. |
--tracing-backend value #
|
The name of the tracing backend to use. |
--tracing-service-name value #
|
Service name to use when reporting traces. (default: "buildkite-agent") |
--no-job-api #
|
Disables the Job API, which gives commands in jobs some abilities to introspect and mutate the state of the job. |
--disable-warnings-for value #
|
A list of warning IDs to disable |
--kubernetes-container-id value #
|
This is intended to be used only by the Buildkite k8s stack (github.com/buildkite/agent-stack-k8s); it sets an ID number used to identify this container within the pod (default: 0) |
--cancel-signal value #
|
The signal to use for cancellation (default: "SIGTERM") |
--cancel-grace-period value #
|
The number of seconds a canceled or timed out job is given to gracefully terminate and upload its artifacts (default: 10) |
--signal-grace-period-seconds 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 is `cancel-grace-period` - 1. (default: -1) |
--debug #
|
Enable debug mode. Synonym for `--log-level debug`. Takes precedence over `--log-level` |
--log-level 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 (default: "notice") |
--experiment value #
|
Enable experimental features within the buildkite-agent |
--profile value #
|
Enable a profiling mode, either cpu, memory, mutex or block |
--redacted-vars value #
|
Pattern of environment variable names containing sensitive values (default: "*_PASSWORD", "*_SECRET", "*_TOKEN", "*_PRIVATE_KEY", "*_ACCESS_KEY", "*_SECRET_KEY", "*_CONNECTION_STRING") |
--strict-single-hooks #
|
Enforces that only one checkout hook, and only one command hook, can be run |
--kubernetes-exec #
|
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 |
--trace-context-encoding value #
|
Sets the inner encoding for BUILDKITE_TRACE_CONTEXT. Must be either json or gob (default: "gob") |