# `Pipette.Constructors`
[🔗](https://github.com/tommeier/pipette-buildkite-plugin/blob/main/lib/pipette/constructors.ex#L1)

Convenience constructors for building pipeline structs at runtime.

Use these in `extra_groups` callbacks and tests where you need to
create `Pipette.Step` and `Pipette.Group` structs outside the DSL:

    import Pipette.Constructors

    def discover_packages(ctx, changed_files) do
      [group(:pkg_foo, label: "Foo", key: "pkg-foo", steps: [
        step(:test, label: "Test", command: "mix test", key: "pkg-foo-test")
      ])]
    end

These are thin wrappers around `struct!/2` — identical to the
convenience functions that existed in `Pipette.DSL` before v0.4.0.

# `branch`

```elixir
@spec branch(
  String.t(),
  keyword()
) :: Pipette.Branch.t()
```

Build a `%Pipette.Branch{}` with the given pattern.

# `group`

```elixir
@spec group(
  atom(),
  keyword()
) :: Pipette.Group.t()
```

Build a `%Pipette.Group{}` with the given name.

# `scope`

```elixir
@spec scope(
  atom(),
  keyword()
) :: Pipette.Scope.t()
```

Build a `%Pipette.Scope{}` with the given name.

# `step`

```elixir
@spec step(
  atom(),
  keyword()
) :: Pipette.Step.t()
```

Build a `%Pipette.Step{}` with the given name.

# `trigger`

```elixir
@spec trigger(
  atom(),
  keyword()
) :: Pipette.Trigger.t()
```

Build a `%Pipette.Trigger{}` with the given name.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
