builder-web/bin/builder_system.ml
Hannes Mehnert f7bc55f2e3 execute all executables in <conigdir>/upload-hooks when an upload succeeded
Only uploads with a single main binary invoke the hooks (since they use the
main_binary)
2022-02-21 13:05:16 +00:00

17 lines
578 B
OCaml

let uname =
let cmd = Bos.Cmd.(v "uname" % "-s") in
lazy (match Bos.OS.Cmd.(run_out cmd |> out_string |> success) with
| Ok s when s = "FreeBSD" -> `FreeBSD
| Ok s when s = "Linux" -> `Linux
| Ok s -> invalid_arg (Printf.sprintf "OS %s not supported" s)
| Error (`Msg m) -> invalid_arg m)
let default_datadir =
match Lazy.force uname with
| `FreeBSD -> "/var/db/builder-web"
| `Linux -> "/var/lib/builder-web"
let default_configdir =
match Lazy.force uname with
| `FreeBSD -> "/usr/local/etc/builder-web"
| `Linux -> "/etc/builder-web"