Mate.Pipeline (Mate v0.1.2) View Source

This module keeps track of the build and deploy pipelines.

It will use the given steps from your Mate.Config to either build or deploy your application on the specified servers. The default steps will attempt to sniff whether or not you are in need of the assets pipeline, which uses npm by default.

The pipeline can be updated with custom steps using the configuration file .mate.exs, for example you can add a custom step module with the Mate.Pipeline.Step behaviour.

config :mate,
  steps: fn steps, pipeline ->
    pipeline.insert_before(steps, Mate.Step.CleanBuild, CustomStep)
  end,

  defmodule CustomStep do
    use Mate.Pipeline.Step

    @impl true
    def run(session) do
      IO.puts("Execute my custom code")
      {:ok, session}
    end
  end

You can also use useful commands like local_cmd/2, local_cmd/3, local_script/2, remote_cmd/2, remote_cmd/3, remote_script/2, copy_from/3 and copy_to/3 to interact with the local machine or with the build server in various ways.

Link to this section Summary

Link to this section Types

Specs

step() :: atom() | function()

Specs

steps() :: [step()]

Specs

t() :: %Mate.Pipeline{
  current_step: atom(),
  next_step: atom(),
  prev_step: atom(),
  steps: steps()
}

Link to this section Functions

Specs

default_steps() :: steps()
Link to this function

insert_after(steps, target, new)

View Source

Specs

insert_after(steps(), step(), step()) :: steps()
Link to this function

insert_before(steps, target, new)

View Source

Specs

insert_before(steps(), step(), step()) :: steps()

Specs

new() :: t()

Specs

new(steps()) :: t()

Specs

remove(steps(), step()) :: steps()
Link to this function

replace(steps, target, new)

View Source

Specs

replace(steps(), step(), step()) :: steps()

Specs

run(Mate.Session.t()) :: {:ok, Mate.Session.t()} | {:error, any()}

Specs

run_step(Mate.Session.t(), step()) :: Mate.Session.t()
run_step(steps(), [Mate.Session.t()]) ::
  {:ok, Mate.Session.t()} | {:error, any()}