edeliver_fork v1.4.5 Edeliver.Relup.InsertInstruction

Provides functions to insert relup instructions at a given position

which can be used in Edeliver.Relup.Instruction behaviour implementations in the relup file.

Summary

Functions

Appends instruction(s) to the list of other instructions

Appends instruction(s) to the instruction after the “point of no return” but before any instruction

Inserts instruction(s) after the given instruction

Inserts instruction(s) right after the last load_object_code instruction

Inserts instruction(s) right after the point of no return

Inserts instruction(s) before the given instruction

Inserts instruction(s) before the point of no return

Returns true if the given instruction is an instruction which modifies an application

Returns true if the given instruction is an instruction which modifies code

Returns true if the given instruction is an instruction which modifies any process

Functions

append(instructions, new_instructions)

Appends instruction(s) to the list of other instructions.

append_after_point_of_no_return(instructions, new_instructions)

Appends instruction(s) to the instruction after the “point of no return” but before any instruction

which:

  • loads or unloads new code, which means before any load_module, load, add_module, delete_module, remove, purge instruction and
  • before any instruction which updates, starts or stops any running processes, which means before any code_change, update, start, stop instruction and
  • before any instruction which (re-)starts or stops any application or the emulator, which means before any add_application, remove_application, restart_application, restart_emulator and restart_new_emulator instruction.

    It does not consider load-instructions for Edeliver.Relup.RunnableInstructions as code loading instructions for the release. They are inserted by the RunnableInstruction itself to ensure that the code of the runnable instruction is loaded before the instruction is executed. See Edeliver.Relup.ShiftInstruction.ensure_module_loaded_before_instruction/3.

insert_after_instruction(instructions, new_instructions, after_instruction)

Inserts instruction(s) after the given instruction.

insert_after_load_object_code(instructions, new_instructions)

Inserts instruction(s) right after the last load_object_code instruction

which is usually before the “point of no return” and one of the first instructions. This means that it is the first custom instruction which is executed. It is executed twice, once when checking whether the upgrade can be installed and once when the upgrade is installed.

insert_after_point_of_no_return(instructions, new_instructions)

Inserts instruction(s) right after the point of no return.

This means that it is the first instruction which should not fail, because the release handler will restart the release if any instruction fails after the point of no return.

insert_before_instruction(instructions, new_instructions, before_instruction)

Inserts instruction(s) before the given instruction.

insert_before_point_of_no_return(instructions, new_instructions)

Inserts instruction(s) before the point of no return.

All instructions running before that point of no return which fail will cause the upgrade to fail, while failing instructions running after that point will cause the node to restart the release.

modifies_applications?(arg1)

Specs

modifies_applications?(Edeliver.Relup.Instructions.instruction) :: boolean

Returns true if the given instruction is an instruction which modifies an application

by either (re-)starting or stopping it or by restarting the emulator. It returns true for the add_application, remove_application, restart_new_emulator and the restart_emulator, relup instructions.

modifies_code?(arg1)

Specs

modifies_code?(Edeliver.Relup.Instructions.instruction) :: boolean

Returns true if the given instruction is an instruction which modifies code

by loading, unloading or purging it. It returns true for the load_module, add_module delete_module, load, remove and purge relup instructions.

modifies_processes?(arg1)

Specs

modifies_processes?(Edeliver.Relup.Instructions.instruction) :: boolean

Returns true if the given instruction is an instruction which modifies any process

by either by sending the code_change sys event or by starting or stopping any process. It returns true for the code_change, start, stop and update relup instructions.