edeliver v1.2.7 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:
Edeliver.Relup.Instructions.CheckProcessesRunningOldCodeEdeliver.Relup.Instructions.CheckRanchAcceptorsEdeliver.Relup.Instructions.CheckRanchConnectionsEdeliver.Relup.Instructions.CodeChangeOnAppProcessesEdeliver.Relup.Instructions.FinishRunningRequestsEdeliver.Relup.Instructions.InfoEdeliver.Relup.Instructions.ReloadModulesEdeliver.Relup.Instructions.RerunFailedRequestsEdeliver.Relup.Instructions.ResumeAppProcessesEdeliver.Relup.Instructions.ResumeChannelsEdeliver.Relup.Instructions.ResumeRanchAcceptorsEdeliver.Relup.Instructions.SleepEdeliver.Relup.Instructions.SoftPurgeEdeliver.Relup.Instructions.StartSectionEdeliver.Relup.Instructions.SuspendAppProcessesEdeliver.Relup.Instructions.SuspendChannelsEdeliver.Relup.Instructions.SuspendRanchAcceptors
Summary
Callbacks
Specs
modify_relup(Edeliver.Relup.Instructions.t, ReleaseManager.Config.t) :: Edeliver.Relup.Instructions.t