View Source Horizon.Ops.Utils (horizon v0.2.5)
Horizon.Ops is a tool for building and deploying Elixir applications to FreeBSD hosts.
Summary
Functions
Copy a file from source to target, overwriting if necessary.
Create a file from a template.
Safely copy a file from source to target.
Validate the releases configuration for nil values.
Functions
@spec copy_static_file( {String.t(), String.t()}, boolean(), boolean(), keyword(), function() ) :: no_return()
Copy a file from source to target, overwriting if necessary.
Example
iex> safe_copy_file(
...> :horizon_helpers,
...> app,
...> overwrite,
...> false,
...> opts,
...> &Path.join(&2[:bin_path], &1)
...> )
@spec create_file_from_template( {String.t(), String.t()}, String.t() | atom(), boolean(), boolean(), keyword(), function(), function() ) :: no_return()
Create a file from a template.
Example
iex> create_file_from_template("source", "target", true, false, %{}, &assigns/2, fn target,
...> opts ->
...> target
...> end)
Safely copy a file from source to target.
Example
iex> safe_copy_file("source", "target", true)
Created target
@spec validate_releases(keyword()) :: :ok | nil
Validate the releases configuration for nil values.
Examples
iex> validate_releases([..., build_user: nil, ..]) # => ["phx_only -> build_user", "phx_only -> build_host"] releases