Module Dockerfile_cmd

Command invocation library to help with Docker builds.

This module primarily exposes utility functions to glue together Docker-based scripts for (e.g.) continuous integration systems like the ocaml-ci. The interface is fairly domain-specific and does not expose all the functionality of the underlying tools. Feel free to contribute more functions if you need them.

type cmd_log = {
command : string;
stdout : string;
success : bool;
status : [ `Signaled of int | `Exited of int ];
}

Results of a command invocation

include sig ... end
val cmd_log_of_sexp : Sexplib.Sexp.t ‑> cmd_log
val sexp_of_cmd_log : cmd_log ‑> Sexplib.Sexp.t
val run_log : ?⁠ok_to_fail:bool ‑> ?⁠env:Bos.OS.Env.t ‑> Fpath.t ‑> string ‑> Bos.Cmd.t ‑> (unit, [> Rresult.R.msg ]) Pervasives.result

runlog log_dir name cmd will run cmd with label name and log the results in <log_dir>/<name>.sxp.

module Docker : sig ... end
module Parallel : sig ... end
module Opam : sig ... end

Utility functions

val setup_logs : unit ‑> unit Cmdliner.Term.t

setup_logs () initialises a Logs environment.

val iter : ('a ‑> (unit, 'b) Pervasives.result) ‑> 'a list ‑> (unit, 'b) Pervasives.result
val map : ('a ‑> ('b'c) Pervasives.result) ‑> 'a list ‑> ('b list, 'c) Pervasives.result