Source file config.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(** Configuration for a single sandboxed build step.
    This is passed by the builder to the sandbox. *)

open Sexplib.Std

type env = (string * string) list [@@deriving sexp]

module Mount = struct
  type t = { (* TODO: options *)
    src : string;              (* In host namespace *)
    dst : string;              (* In container namespace *)
    readonly : bool;
  }
end

module Secret = struct
  type t = {
    value: string;
    target: string;
  } [@@deriving sexp]
end

type t = {
  cwd : string;
  argv : string list;
  hostname : string;
  user : Obuilder_spec.user;
  env : env;
  mounts : Mount.t list;
  network : string list;
  mount_secrets : Secret.t list;
  entrypoint : string option;
}

let v ~cwd ~argv ~hostname ~user ~env ~mounts ~network ~mount_secrets ?entrypoint () =
  { cwd; argv; hostname; user; env; mounts; network; mount_secrets; entrypoint; }