Akd v0.2.0-rc.0 Akd.Build.Phoenix.Npm View Source
A native Hook module that comes shipped with Akd.
This module uses Akd.Hook
.
Provides a set of operations that build a npm release for a given phoenix app
at a deployment’s build_at
destination. This hook assumes that a package.json
is present.
Ensures to cleanup and remove node_modules folder created by this build.
Doesn’t have any Rollback operations.
Options:
- run_ensure: boolean. Specifies whether to a run a command or not.
- ignore_failure: boolean. Specifies whether to continue if this hook fails.
- cmd_env: list of tuples. Specifies the environments to provide while building the distillery release.
- package_path: string. Path to package.json
Defaults:
run_ensure
:true
ignore_failure
:false
package_path
: “.”
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(Akd.Deployment.t(), list()) :: Akd.Hook.t()
Callback implementation for get_hooks/2
.
This function returns a list of operations that can be used to build a npm
release on the build_at
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.Build.Phoenix.Npm.get_hooks(deployment, [])
[%Akd.Hook{ensure: [%Akd.Operation{cmd: "cd \n rm -rf node_modules",
cmd_envs: [],
destination: %Akd.Destination{host: :local, path: ".",
user: :current}}], ignore_failure: false,
main: [%Akd.Operation{cmd: "cd \n npm install", cmd_envs: [],
destination: %Akd.Destination{host: :local, path: ".",
user: :current}}], rollback: [], run_ensure: true}]