nomadex v0.1.0 Nomadex.Task

Nomad task definition. More information available at https://www.nomadproject.io/docs/job-specification/task.html

Summary

Functions

Add artifact required to run task

Create new Nomadex.Task with provided driver

Types

driver()
driver() :: atom
t()
t() :: %Nomadex.Task{artifacts: [map], config: map, constraints: list, driver: driver, env: %{optional(String.t) => String.t}, leader: boolean, meta: Nomadex.meta, name: String.t, payload_file: bitstring, services: list | nil, user: String.t | nil}

Functions

add_artifact(task, opts)
add_artifact(t, keyword) :: t

Add artifact required to run task.

Options:

  • :source - source of the artifact
  • :dest - destination of the artifact relative to the task’s directory
  • :opts - additional options, to be found here

Examples

iex> task = Nomadex.Task.new(:exec)
...>        |> Nomadex.Task.add_artifact(source: "http://example.com/task.tgz")
iex> hd(task.artifacts)
%{
  "GetterOptions" => %{},
  "GetterSource" => "http://example.com/task.tgz",
  "RelativeDest" => "local/"
}
new(driver)
new(driver) :: t

Create new Nomadex.Task with provided driver

raw_exec(command, args \\ [])