Adify v0.1.0 Adify
This module is the main API to interact with Adify
A configurable, extendable DevOps environment app. This app installs tools based on the given operating systems.
Link to this section Summary
Link to this section Functions
Link to this function
default(arg1)
Returns default options set for a specific key
Examples
# When the key is `:confirm`
iex> Adify.default(:confirm)
true
# When the key is `:digest_file`
iex> path = Adify.default(:digest_file)
iex> path == Path.join([System.user_home(), ".adify", ".digest"])
true
# When the key is `:tools_dir`
iex> path = Adify.default(:tools_dir)
iex> path == Path.join(:code.priv_dir(:adify), "tools")
true
# When the key is `:os`
iex> os1 = Adify.default(:os)
iex> {:ok, os} = Adify.SystemInfo.current_os()
iex> os1 == os
true
# When there's some other key
iex> Adify.default(:other_key)
nil
Link to this function
run(opts \\ [])
Runs an adifying process
Takes a Keyword as an argument with optional keys:
:confirm
: Boolean; Specifies whether a confirmation is needed before updating the state of the system.:digest_file
: String, Path; Specifies the location of adify digest file generated after adification.:tools_dir
: String, Path; Specifies the location of the directory that contains files corresponding to tools, configuration files and yaml files that is needed for adification.
Examples:
iex> tools_dir = "./test/support/tools/"
iex> digest_file = ".temp.dump"
iex> File.rm(digest_file)
iex> false = File.exists?(digest_file)
iex> {:ok, digest} = Adify.run(
...> confirm: false,
...> tools_dir: tools_dir,
...> digest_file: digest_file,
...> os: "arch_linux",
...> )
iex> true = File.exists?(digest_file)
iex> File.rm!(digest_file)
:ok