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_static_file(arg, overwrite, executable, opts, target_fn)

@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)
  ...> )

create_file_from_template(arg, app, overwrite, executable, opts, assigns_fn, target_fn)

@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)

safe_copy_file(source, target, overwrite, executable \\ false)

@spec safe_copy_file(String.t(), String.t(), boolean(), boolean()) :: no_return()

Safely copy a file from source to target.

Example

    iex> safe_copy_file("source", "target", true)
    Created target

safe_write(data, file, overwrite, executable \\ false)

validate_releases(releases)

@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