adapt to builder changes (job -> script_job)
This commit is contained in:
parent
b279eb521b
commit
88377adb7c
3 changed files with 5 additions and 5 deletions
|
@ -34,7 +34,7 @@ let init dbpath datadir =
|
||||||
>>= fun () ->
|
>>= fun () ->
|
||||||
Model.cleanup_staging datadir (module Db))
|
Model.cleanup_staging datadir (module Db))
|
||||||
|
|
||||||
let pp_exec ppf (job, uuid, _, _, _, _, _) =
|
let pp_exec ppf ((job : Builder.script_job), uuid, _, _, _, _, _) =
|
||||||
Format.fprintf ppf "%s(%a)" job.Builder.name Uuidm.pp uuid
|
Format.fprintf ppf "%s(%a)" job.Builder.name Uuidm.pp uuid
|
||||||
|
|
||||||
let safe_seg path =
|
let safe_seg path =
|
||||||
|
@ -180,7 +180,7 @@ let add_routes datadir =
|
||||||
|> if_error ~status:`Bad_Request "Bad request"
|
|> if_error ~status:`Bad_Request "Bad request"
|
||||||
~log:(fun e ->
|
~log:(fun e ->
|
||||||
Log.warn (fun m -> m "Received bad builder ASN.1: %a" pp_error e))
|
Log.warn (fun m -> m "Received bad builder ASN.1: %a" pp_error e))
|
||||||
>>= fun (({ name ; _ }, uuid, _, _, _, _, _) as exec) ->
|
>>= fun ((({ name ; _ } : Builder.script_job), uuid, _, _, _, _, _) as exec) ->
|
||||||
Log.debug (fun m -> m "Received build %a" pp_exec exec);
|
Log.debug (fun m -> m "Received build %a" pp_exec exec);
|
||||||
Authorization.authorized req name
|
Authorization.authorized req name
|
||||||
|> if_error ~status:`Forbidden "Forbidden" >>= fun () ->
|
|> if_error ~status:`Forbidden "Forbidden" >>= fun () ->
|
||||||
|
|
|
@ -166,7 +166,7 @@ let save_files dir staging files =
|
||||||
(Lwt_result.return [])
|
(Lwt_result.return [])
|
||||||
files
|
files
|
||||||
|
|
||||||
let save_all staging_dir ((job, uuid, _, _, _, _, artifacts) as exec) =
|
let save_all staging_dir (((job : Builder.script_job), uuid, _, _, _, _, artifacts) as exec) =
|
||||||
let build_dir = Fpath.(v job.Builder.name / Uuidm.to_string uuid) in
|
let build_dir = Fpath.(v job.Builder.name / Uuidm.to_string uuid) in
|
||||||
let output_dir = Fpath.(build_dir / "output")
|
let output_dir = Fpath.(build_dir / "output")
|
||||||
and staging_output_dir = Fpath.(staging_dir / "output") in
|
and staging_output_dir = Fpath.(staging_dir / "output") in
|
||||||
|
@ -188,7 +188,7 @@ let commit_files datadir staging_dir job_name uuid =
|
||||||
let add_build
|
let add_build
|
||||||
datadir
|
datadir
|
||||||
user_id
|
user_id
|
||||||
((job, uuid, console, start, finish, result, _) as exec)
|
(((job : Builder.script_job), uuid, console, start, finish, result, _) as exec)
|
||||||
(module Db : CONN) =
|
(module Db : CONN) =
|
||||||
let open Builder_db in
|
let open Builder_db in
|
||||||
let job_name = job.Builder.name in
|
let job_name = job.Builder.name in
|
||||||
|
|
|
@ -62,7 +62,7 @@ val authorized : Builder_db.id -> string -> Caqti_lwt.connection -> (unit, [> Ca
|
||||||
val add_build :
|
val add_build :
|
||||||
Fpath.t ->
|
Fpath.t ->
|
||||||
Builder_db.id ->
|
Builder_db.id ->
|
||||||
(Builder.job * Uuidm.t * (int * string) list * Ptime.t * Ptime.t *
|
(Builder.script_job * Uuidm.t * (int * string) list * Ptime.t * Ptime.t *
|
||||||
Builder.execution_result * (Fpath.t * string) list) ->
|
Builder.execution_result * (Fpath.t * string) list) ->
|
||||||
Caqti_lwt.connection ->
|
Caqti_lwt.connection ->
|
||||||
(unit, [> Caqti_error.call_or_retrieve | `Msg of string ]) result Lwt.t
|
(unit, [> Caqti_error.call_or_retrieve | `Msg of string ]) result Lwt.t
|
||||||
|
|
Loading…
Reference in a new issue