Akd v0.2.0-rc.0 Akd.HookResolver View Source

This module defines functions which can be used to resolve hooks, given a hook_type and defaults.

This module is mainly intended to be used by Akd.DeployHelper for resolving hooks that it gets from Akd.Pipeline DSL.

Link to this section Summary

Functions

Returns hooks associated with build

Returns hooks associated with fetch

Returns hooks associated with init

Returns hooks associated with publish

Returns hooks associated with start

Returns hooks associated with stop

Link to this section Functions

Returns hooks associated with build.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.build.get_hooks(deployment, [])
iex> Akd.HookResolver.build(deployment, []) == hooks
true

Returns hooks associated with fetch.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.fetch.get_hooks(deployment, [])
iex> Akd.HookResolver.fetch(deployment, []) == hooks
true

Returns hooks associated with init.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.init.get_hooks(deployment, [])
iex> Akd.HookResolver.init(deployment, []) == hooks
true
Link to this function publish(deployment, opts) View Source

Returns hooks associated with publish.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.publish.get_hooks(deployment, [])
iex> Akd.HookResolver.publish(deployment, []) == hooks
true

Returns hooks associated with start.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.start.get_hooks(deployment, [])
iex> Akd.HookResolver.start(deployment, []) == hooks
true

Returns hooks associated with stop.

Takes in a deployment and opts. If opts is empty, just calls the default module.

Examples

When opts is empty:

iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> hooks = Akd.stop.get_hooks(deployment, [])
iex> Akd.HookResolver.stop(deployment, []) == hooks
true