Upward.Appup.Transform behaviour (upward v0.0.4)

View Source

A transform is an appup compilation pass which receives a list of appup instructions, along with metadata about those instructions, such as the source application, the source and target versions involved, and an optional list of configuration options for the transform.

The job of a transform is to, well, apply a transformation to the instruction set, in order to accomplish some objective that one desires to be automated. A trivial example of one such transform would be a transform which ensures the purge mode is set to :soft_purge for all :update instructions. To see an example of such a transform, look in test/support/purge_transform.ex

Summary

Functions

Applies all transforms against the current downgrade instruction.

Applies all transforms against the current upgrade instruction.

Types

app()

@type app() :: Upward.Appup.app()

instruction()

@type instruction() :: Upward.Appup.instruction()

options()

@type options() :: [term()]

transform()

@type transform() :: module() | {module(), options()}

version()

@type version() :: Upward.Appup.appup_ver()

Callbacks

down(app, version, version, list, options)

@callback down(app(), version(), version(), [instruction()], options()) :: [instruction()]

up(app, version, version, list, options)

@callback up(app(), version(), version(), [instruction()], options()) :: [instruction()]

Functions

down(instructions, app, v1, v2, list)

@spec down([instruction()], app(), version(), version(), [transform()]) :: [
  instruction()
]

Applies all transforms against the current downgrade instruction.

Additional information required as arguments and passed to transforms are the app the instruction applies to, and the source and target versions involved.

up(instructions, app, v1, v2, list)

@spec up([instruction()], app(), version(), version(), [transform()]) :: [
  instruction()
]

Applies all transforms against the current upgrade instruction.

Additional information required as arguments and passed to transforms are the app the instruction applies to, and the source and target versions involved.