buildkite-agent annotate
The Buildkite agent's annotate command allows you to add additional information to Buildkite build pages using CommonMark Markdown.
Learn more about how to use this command in Annotations.
Creating an annotation
The buildkite-agent annotate command creates an annotation associated with the current build.
Options for the annotate command can be found in the buildkite-agent cli help:
Usage
buildkite-agent annotate [body] [options...]
Description
Build annotations allow you to customize the Buildkite build interface to show information that may surface from your builds. Some examples include:
- Links to artifacts generated by your jobs
- Test result summaries
- Graphs that include analysis about your codebase
- Helpful information for team members about what happened during a build
Annotations are written in CommonMark-compliant Markdown, with "GitHub Flavored Markdown" extensions.
The annotation body can be supplied as a command line argument, or by piping content into the command. The maximum size of each annotation body is 1MiB.
You can update an existing annotation's body by running the annotate command again and provide the same context as the one you want to update. Or if you leave context blank, it will use the default context.
You can also update only the style of an existing annotation by omitting the body entirely and providing a new style value.
Example
$ buildkite-agent annotate "All tests passed! :your-emoji: like 🚀"
$ cat annotation.md | buildkite-agent annotate --style "warning"
$ buildkite-agent annotate --style "success" --context "junit"
$ ./script/dynamic_annotation_generator | buildkite-agent annotate --style "success"
Options
--no-color #
|
Don't show colors in logging (default: false) |
|---|---|
--debug #
|
Enable debug mode. Synonym for `--log-level debug`. Takes precedence over `--log-level` (default: false) |
--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 |
--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 (default: false) |
--debug-http #
|
Enable HTTP debug mode, which dumps all request and response bodies to the log (default: false) |
--trace-http #
|
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 (default: false) |
--context value #
|
The context of the annotation used to differentiate this annotation from others. This value has a limit of 100 characters. |
--style value #
|
The style of the annotation (`success`, `info`, `warning` or `error`) |
--append #
|
Append to the body of an existing annotation (default: false) |
--priority value #
|
The priority of the annotation (`1` to `10`). Annotations with a priority of `10` are shown first, while annotations with a priority of `1` are shown last. (default: 3) |
--job value #
|
Which job should the annotation come from |
--scope value #
|
The scope of the annotation, which will control where the annotation is displayed in the Buildkite UI. One of 'build', 'job' (default: "build") |
--redacted-vars value #
|
Pattern of environment variable names containing sensitive values (default: "*_PASSWORD", "*_SECRET", "*_TOKEN", "*_PRIVATE_KEY", "*_ACCESS_KEY", "*_SECRET_KEY", "*_CONNECTION_STRING") |
Removing an annotation
Annotations can be removed using the buildkite-agent annotation remove command.