View Source Horizon.Ops.BSD.Utils (horizon v0.2.5)

Horizon.Ops is a tool for building and deploying Elixir applications to FreeBSD hosts.

Summary

Functions

Assigns the application and options to a keyword list.

Returns the options, with defaults inserted, for each release. If no releases are defined in the mix.exs file, a default release returned.

Returns a tuple with the full source path and the target file name. Files are referenced with an atom.

Validate that the assets.setup.freebsd alias exists in the mix.exs file.

Functions

assigns(app, opts)

@spec assigns(
  atom(),
  keyword()
) :: keyword()

Assigns the application and options to a keyword list.

get_config_releases()

Returns the options, with defaults inserted, for each release. If no releases are defined in the mix.exs file, a default release returned.

This is the configured options for releases that you set for each release in mix.exs and can be inspected with Mix.Project.config()[:releases]. Not to be confused with the %Mix.Release{} struct that is passed to each Step. The options here are stored in the Mix.Release.options field.

get_src_path(dir, source)

@spec get_src_path(String.t(), String.t()) :: String.t() | no_return()

get_src_tgt(key, app)

@spec get_src_tgt(atom(), String.t() | atom()) :: {String.t(), String.t()}

Returns a tuple with the full source path and the target file name. Files are referenced with an atom.

Note that files in the scripts folder are expected to keep the same name from source to target. These static scripts will only be copied to the a bin/ folder one time.

Examples

  iex> get_src_tgt(:stage, "foo")
  {"/path_to_horizon/priv/templates/bin/stage.sh.eex", "stage-foo.sh"}

warn_is_missing_freebsd_alias(mix_config)

@spec warn_is_missing_freebsd_alias(keyword()) :: no_return()

Validate that the assets.setup.freebsd alias exists in the mix.exs file.