Akd v0.3.0 Akd.Publish.Release View Source
A native Hook module that comes shipped with Akd.
This module uses Akd.Hook.
Provides a set of operations to evaluate some elixir code after publishing the release
Options:
run_ensure:boolean. Specifies whether to a run a command or not.ignore_failure:boolean. Specifies whether to continue if this hook fails.eval:string. Elixir code to evaluate"
Defaults:
run_ensure:trueignore_failure:false
Link to this section Summary
Functions
Callback implementation for get_hooks/2
Link to this section Functions
Link to this function
get_hooks(deployment, opts)
View Source
get_hooks(deployment, opts)
View Source
get_hooks(Akd.Deployment.t(), list()) :: Akd.Hook.t()
get_hooks(Akd.Deployment.t(), Keyword.t()) :: [Akd.Hook.t()]
get_hooks(Akd.Deployment.t(), list()) :: Akd.Hook.t()
get_hooks(Akd.Deployment.t(), Keyword.t()) :: [Akd.Hook.t()]
Callback implementation for get_hooks/2.
This function returns a list of operations that can be used to publish a release
on the publish_to destination of a deployment.
Examples
iex> deployment = %Akd.Deployment{mix_env: "prod",
...> build_at: Akd.Destination.local("."),
...> publish_to: Akd.Destination.local("."),
...> name: "name",
...> vsn: "0.1.1"}
iex> Akd.Publish.Release .get_hooks(deployment, [])
[%Akd.Hook{ensure: [%Akd.Operation{cmd: "rm ./name-0.1.1.tar.gz",
cmd_envs: [],
destination: %Akd.Destination{host: :local, path: ".",
user: :current}}], ignore_failure: false,
main: [%Akd.Operation{cmd: "cp ./_build/prod/name-0.1.1.tar.gz .\n",
cmd_envs: [],
destination: %Akd.Destination{host: :local, path: ".",
user: :current}}], rollback: [], run_ensure: true},
%Akd.Hook{ensure: [], ignore_failure: false,
main: [%Akd.Operation{cmd: "cd .\ntar xzf name-0.1.1.tar.gz\n",
cmd_envs: [],
destination: %Akd.Destination{host: :local, path: ".",
user: :current}}], rollback: [], run_ensure: true}]