edeliver v1.2.6 Edeliver.Relup.Instruction behaviour

This behaviour can be used to provide custom instructions to modify the relup.

They can be used in the implementations of of the Edeliver.Relup.Modifcation behaviour.

Example:

defmodule Acme.Relup.LogUpgradeInstruction do
  use Edeliver.Relup.Instruction

  def modify_relup(instructions = %Instructions{up_instructions: up_instructions}, _config = %Config{}) do
    log_instruction = {:apply, {:"Elixir.Logger", :info, [<<"Upgraded successfully">>]}}
    %{instructions| up_instructions: [log_instruction|up_instructions]}
  end

end

# using the instruction
defmodule Acme.Relup.Modification do
  use Edeliver.Relup.Modification

  def modify_relup(instructions = %Instructions{}, _config = %Config{}) do
    instructions |> Edeliver.Relup.DefaultModification.modify_relup(Config) # use default modifications
                 |> Acme.Relup.LogUpgradeInstruction.modify_relup(Config) # apply also custom instructions
  end
end

edeliver already provides a set of relup instructions:

Summary

Callbacks

modify_relup(arg0, arg1)

Specs

modify_relup(Edeliver.Relup.Instructions.t, ReleaseManager.Config.t) :: Edeliver.Relup.Instructions.t