Pipette.Constructors (Pipette v0.5.1)

Copy Markdown View Source

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.

Summary

Functions

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

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

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

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

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

Functions

branch(pattern, opts \\ [])

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

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

group(name, opts \\ [])

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

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

scope(name, opts \\ [])

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

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

step(name, opts \\ [])

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

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

trigger(name, opts \\ [])

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

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