ExDockerCompose v0.2.0 ExDockerCompose.RunServer View Source

The worker module, this is a GenServer that handles running of docker-compose commands. The module tracks all commands that were requested to run.

Link to this section Summary

Functions

Initialize the server

Parameters

  • args - a Keyword list with the following keys:

    • compose_bin - A full path to the docker-compose binary file. This will be used in order to run the commands

Runs the given subcommand and opts. See ExDockerCompose functions documentation for the expected syntax of opts

Same as ExDockerCompose.RunServer.run/2, only that raises an exception if there’s an error

Link to this section Types

Link to this type t() View Source
t() :: %ExDockerCompose.RunServer{compose_bin: String.t(), in_flight_procs: Map.t(), outputs: Map.t()}

Link to this section Functions

Initialize the server

Parameters

  • args - a Keyword list with the following keys:

    • compose_bin - A full path to the docker-compose binary file. This will be used in order to run the commands.
Link to this function run(subcommand, compose_opts, opts) View Source
run(subcommand :: Atom.t(), compose_opts :: List.t(), opts :: List.t()) ::
  :ok |
  {:error, reason :: String.t()}

Runs the given subcommand and opts. See ExDockerCompose functions documentation for the expected syntax of opts.

Parameters

Examples

iex> ExDockerCompose.RunServer.run(:up, [{:f "compose.yaml"}], [:d, {:timeout, 10}])
:ok

iex> ExDockerCompose.RunServer.run(:up, [], [])
:ok

iex> ExDockerCompose.RunServer.run(:no_such_command, [], [])
{:error, "Command no_such_command not found"}
Link to this function run!(subcommand, compose_opts, opts) View Source
run!(subcommand :: Atom.t(), compose_opts :: List.t(), opts :: List.t()) ::
  :ok |
  no_return()

Same as ExDockerCompose.RunServer.run/2, only that raises an exception if there’s an error.

Examples

iex> ExDockerCompose.RunServer.run!(:up, [{:f, "compose.yml"}], [:d, {:timeout, 10}])
:ok

iex> ExDockerCompose.RunServer.run!(:no_such_command, [], [:d, {:timeout, 10}])