Serializes pipeline groups/steps to Buildkite YAML format.
Converts Pipette.Group, Pipette.Step, and Pipette.Trigger structs
into a Buildkite pipeline YAML document using Ymlr.
Usage
groups = [
%Pipette.Group{
name: :backend,
label: ":elixir: Backend",
key: "backend",
steps: [
%Pipette.Step{
name: :test,
label: ":test_tube: Test",
command: "mix test",
key: "backend-test"
}
]
}
]
Pipette.Buildkite.to_yaml(groups)Produces:
---
steps:
- group: ':elixir: Backend'
key: backend
steps:
- label: ':test_tube: Test'
key: backend-test
command: mix testPipeline-level configuration and triggers can be passed as additional arguments:
Pipette.Buildkite.to_yaml(groups, %{env: %{LANG: "C.UTF-8"}}, triggers)
Summary
Functions
Serialize groups, pipeline config, and triggers to a Buildkite YAML document.
Functions
@spec to_yaml([Pipette.Group.t()], map(), [Pipette.Trigger.t()]) :: String.t()
Serialize groups, pipeline config, and triggers to a Buildkite YAML document.
Returns a YAML string starting with --- that can be piped to
buildkite-agent pipeline upload.
Examples
groups = [%Pipette.Group{name: :api, label: ":elixir: API", key: "api", steps: [...]}]
yaml = Pipette.Buildkite.to_yaml(groups)
yaml = Pipette.Buildkite.to_yaml(groups, %{env: %{MIX_ENV: "test"}}, triggers)