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 thedocker-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 section Functions
Initialize the server
Parameters
args
- a Keyword list with the following keys:compose_bin
- A full path to thedocker-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
.
Parameters
subcommand
- Thedocker-compose
subcommand to runcompose_opts
- A list with options for the docker-compose command. Refer toExDockerCompose.Subcommands.build_command/4
for the expected syntaxopts
- A list with options for the subcommand. Refer toExDockerCompose.Subcommands.build_command/4
for the expected syntax
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"}
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}])