buildkite.star¶
Edit Buildkite pipelines: plugin versions, agent queues and step defaults.
Edits are line-based, so comments, anchors and layout in pipeline files
stay as they were. Images used through the docker and docker-compose
plugins are image: lines, so docker.bump_image moves them too.
load("@fleet//buildkite.star", "pipelines", "plugins", "bump_plugin", "queues", "set_queue", "set_step_defaults")
| Function | What it does |
|---|---|
pipelines |
Lists the repo's pipeline files. |
plugins |
Lists every plugin a pipeline uses, with its version. |
bump_plugin |
Moves a plugin to a new version in every pipeline. |
queues |
Lists the agent queues pipelines target. |
set_queue |
Points agents: queue: at a new queue in every pipeline. |
set_step_defaults |
Adds keys, such as timeout_in_minutes, to every command step that lacks them. |
pipelines¶
Lists the repo's pipeline files.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of every YAML file under .buildkite, and of buildkite.yml or buildkite.yaml at the root.
Example
plugins¶
Lists every plugin a pipeline uses, with its version.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: A sorted, de-duplicated list of name#ref strings, such as
docker-compose#v4.14.0.
Example
Used in: buildkite-plugin-bump
bump_plugin¶
Moves a plugin to a new version in every pipeline.
The plugin matches as written, such as docker-compose or
acme/deploy; a full git URL works too. Plugins pinned to a commit SHA
are left alone unless from_ref names it.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
plugin |
The plugin name as pipelines write it. |
to |
The new version, such as v5.4.1. |
from_ref |
When set, only this exact version is replaced. |
Returns: The list of paths that changed.
Example
Used in: buildkite-plugin-bump
queues¶
Lists the agent queues pipelines target.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted, de-duplicated queue names.
Example
set_queue¶
Points agents: queue: at a new queue in every pipeline.
Covers block (queue: x under agents:) and flow (agents: { queue: x })
forms. Pipelines that set no queue are left alone.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
queue |
The new queue name. |
from_queue |
When set, only this queue is replaced, so steps on other queues stay where they are. |
Returns: The list of paths that changed.
Example
Used in: buildkite-agents
set_step_defaults¶
Adds keys, such as timeout_in_minutes, to every command step that lacks them.
A command step is a list item with a command or commands key, at
any depth, so steps inside group steps count. Keys a step already
sets are left as they are, so this never overrides a step's choice.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
values |
A dict of step keys to scalar values, such as {"timeout_in_minutes": 30}. |
Returns: The list of paths that changed.
Example
Used in: buildkite-agents