buildkite-agent meta-data
The Buildkite Agent's meta-data
command provides your build pipeline with a powerful key/value data-store that works across build steps and build agents, no matter the machine or network.
See the Using build meta-data guide for a step-by-step example.
Setting data
Use this command in your build scripts to save string data in the Buildkite meta-data store.
Usage
buildkite-agent meta-data set <key> [value] [options...]
Description
Set arbitrary data on a build using a basic key/value store.
You can supply the value as an argument to the command, or pipe in a file or script output.
The value must be a non-empty string, and strings containing only whitespace characters are not allowed.
Example
$ buildkite-agent meta-data set "foo" "bar"
$ buildkite-agent meta-data set "foo" < ./tmp/meta-data-value
$ ./script/meta-data-generator | buildkite-agent meta-data set "foo"
Options
--job value #
|
Which job's build should the meta-data be set on |
---|---|
--agent-access-token value #
|
The access token used to identify the agent |
--endpoint value #
|
The Agent API endpoint (default: " |
--no-http2 #
|
Disable HTTP2 when communicating with the Agent API. |
--debug-http #
|
Enable HTTP debug mode, which dumps all request and response bodies to the log |
--no-color #
|
Don't show colors in logging |
--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 |
Meta-data values are restricted to a maximum of 100 kilobytes. Keys and values larger than 1 kilobyte are discouraged. Please use artifacts for large data which needs to uploaded and downloaded.
Getting data
Use this command in your build scripts to get a previously saved value from the Buildkite meta-data store.
Usage
buildkite-agent meta-data get <key> [options...]
Description
Get data from a build's key/value store.
Example
$ buildkite-agent meta-data get "foo"
Options
--default value #
|
If the meta-data value doesn't exist return this instead |
---|---|
--job value #
|
Which job's build should the meta-data be retrieved from |
--build value #
|
Which build should the meta-data be retrieved from. --build will take precedence over --job |
--agent-access-token value #
|
The access token used to identify the agent |
--endpoint value #
|
The Agent API endpoint (default: " |
--no-http2 #
|
Disable HTTP2 when communicating with the Agent API. |
--debug-http #
|
Enable HTTP debug mode, which dumps all request and response bodies to the log |
--no-color #
|
Don't show colors in logging |
--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 |
Checking if data exists
Usage
buildkite-agent meta-data exists <key> [options...]
Description
The command exits with a status of 0 if the key has been set, or it will exit with a status of 100 if the key doesn't exist.
Example
$ buildkite-agent meta-data exists "foo"
Options
--job value #
|
Which job's build should the meta-data be checked for |
---|---|
--build value #
|
Which build should the meta-data be retrieved from. --build will take precedence over --job |
--agent-access-token value #
|
The access token used to identify the agent |
--endpoint value #
|
The Agent API endpoint (default: " |
--no-http2 #
|
Disable HTTP2 when communicating with the Agent API. |
--debug-http #
|
Enable HTTP debug mode, which dumps all request and response bodies to the log |
--no-color #
|
Don't show colors in logging |
--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 |
Listing keys
Usage
buildkite-agent meta-data keys [options...]
Description
Lists all meta-data keys that have been previously set, delimited by a newline and terminated with a trailing newline.
Example
$ buildkite-agent meta-data keys
Options
--job value #
|
Which job's build should the meta-data be checked for |
---|---|
--build value #
|
Which build should the meta-data be retrieved from. --build will take precedence over --job |
--agent-access-token value #
|
The access token used to identify the agent |
--endpoint value #
|
The Agent API endpoint (default: " |
--no-http2 #
|
Disable HTTP2 when communicating with the Agent API. |
--debug-http #
|
Enable HTTP debug mode, which dumps all request and response bodies to the log |
--no-color #
|
Don't show colors in logging |
--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 |