sig
module Ssh :
sig
val scp_push :
Ketrew_pure.Host.Ssh.t ->
src:string list -> dest:string -> string list
val scp_pull :
Ketrew_pure.Host.Ssh.t ->
src:string list -> dest:string -> string list
end
module Error :
sig
type 'a execution = 'a
constraint 'a =
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
type 'a non_zero_execution = 'a
constraint 'a =
([> `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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
as 'b)
Ketrew.Host_io.Error.execution
type classified = [ `Fatal of string | `Recoverable of string ]
val classify :
[ `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 Unix_process.Exit_code.t ] *
string
| `System of [ `Sleep of float ] * [ `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ] -> [ `Execution | `Ssh | `Unix ]
val log :
[< `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 Unix_process.Exit_code.t ] *
string
| `System of [< `Sleep of float ] * [< `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ] ->
Ketrew_pure.Internal_pervasives.Log.t
end
type t = Ketrew_pure.Host.t
val default_timeout_upper_bound : float Pervasives.ref
type timeout =
[ `At_most_seconds of float | `Host_default | `None | `Seconds of float ]
val execute :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
type shell = string -> string list
val shell_sh : sh:string -> Ketrew.Host_io.shell
val get_shell_command_output :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val get_shell_command_return_value :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
val run_shell_command :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val do_files_exist :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
Ketrew_pure.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
val get_fresh_playground : Ketrew.Host_io.t -> Ketrew_pure.Path.t option
val ensure_directory :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
path:Ketrew_pure.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val put_file :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
path:Ketrew_pure.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 Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
| `IO of [> `Write_file_exn of Unix_io.IO.path * exn ] ])
Unix_io.Deferred_result.t
val get_file :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
path:Ketrew_pure.Path.t ->
(string,
[> `Cannot_read_file of string * string
| `Timeout of Ketrew_pure.Internal_pervasives.Time.t ])
Unix_io.Deferred_result.t
val grab_file_or_log :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
Ketrew_pure.Path.t ->
(string, Ketrew_pure.Internal_pervasives.Log.t) Unix_io.Deferred_result.t
end