module Ketrew_host_io:sig
..end
module Ssh:sig
..end
module Error:sig
..end
val default_timeout_upper_bound : float Pervasives.ref
typetimeout =
[ `At_most_seconds of float | `Host_default | `None | `Seconds of float ]
`Host_default
→ use the excution_timeout
value of the host. `None
→ force no timeout even if the host has a execution_timeout
.`Seconds f
→ use f
seconds as timeout.`At_most_seconds f
-> use f
seconds, unless the host has a smaller
execution_timeout
field.`At_most_seconds !default_timeout_upper_bound
.val execute : ?timeout:timeout ->
Ketrew_host.t ->
string list ->
(< exited : int; stderr : string; stdout : string >,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution ])
Ketrew_unix_io.Deferred_result.t
Unix.execv
even
on top of SSH.typeshell =
string -> string list
"sh"; "-c"; cmd
val shell_sh : sh:string -> shell
shell_sh "/bin/sh"
for a known path or command).val get_shell_command_output : ?timeout:timeout ->
?with_shell:shell ->
Ketrew_host.t ->
string ->
(string * string,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution Error.non_zero_execution ])
Ketrew_unix_io.Deferred_result.t
(stdout, stderr)
pair
(succeeds iff the exit status is 0
).val get_shell_command_return_value : ?timeout:timeout ->
?with_shell:shell ->
Ketrew_host.t ->
string ->
(int,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution ])
Ketrew_unix_io.Deferred_result.t
val run_shell_command : ?timeout:timeout ->
?with_shell:shell ->
Ketrew_host.t ->
string ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution Error.non_zero_execution ])
Ketrew_unix_io.Deferred_result.t
0
).val do_files_exist : ?timeout:timeout ->
?with_shell:shell ->
Ketrew_host.t ->
Ketrew_path.t list ->
(bool,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution ])
Ketrew_unix_io.Deferred_result.t
val get_fresh_playground : Ketrew_host.t -> Ketrew_path.t option
val ensure_directory : ?timeout:timeout ->
?with_shell:shell ->
Ketrew_host.t ->
path:Ketrew_path.t ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution Error.non_zero_execution ])
Ketrew_unix_io.Deferred_result.t
path
exists on the host.val put_file : ?timeout:timeout ->
Ketrew_host.t ->
path:Ketrew_path.t ->
content:string ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Ketrew_unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Error.execution
| `IO of [> `Write_file_exn of Ketrew_unix_io.IO.path * exn ] ])
Ketrew_unix_io.Deferred_result.t
path
containing contents
.val get_file : ?timeout:timeout ->
Ketrew_host.t ->
path:Ketrew_path.t ->
(string,
[> `Cannot_read_file of string * string
| `Timeout of Ketrew_pervasives.Time.t ])
Ketrew_unix_io.Deferred_result.t
path
.val grab_file_or_log : ?timeout:timeout ->
Ketrew_host.t ->
Ketrew_path.t ->
(string, Ketrew_pervasives.Log.t) Ketrew_unix_io.Deferred_result.t
Ketrew_host_io.get_file
, it fails with a Log.t
(for use in “long-running” plugins).