Model.add_build: pass --platform=<build-platform> to hook scripts

This commit is contained in:
Robur 2022-02-21 14:50:41 +00:00
parent 7bb9e2d8fe
commit 72393c9098

View file

@ -416,12 +416,14 @@ let add_build
let (y, m, d), ((hh, mm, ss), _) = Ptime.to_date_time start in let (y, m, d), ((hh, mm, ss), _) = Ptime.to_date_time start in
Printf.sprintf "%04d%02d%02d%02d%02d%02d" y m d hh mm ss Printf.sprintf "%04d%02d%02d%02d%02d%02d" y m d hh mm ss
and job = job.name and job = job.name
and platform = job.platform
in in
let args = let args =
String.concat " " String.concat " "
(List.map (fun s -> "\"" ^ String.escaped s ^ "\"") (List.map (fun s -> "\"" ^ String.escaped s ^ "\"")
[ "--build-time=" ^ time ; "--sha256=" ^ sha256 ; "--job=" ^ job ; [ "--build-time=" ^ time ; "--sha256=" ^ sha256 ; "--job=" ^ job ;
"--uuid=" ^ uuid ; Fpath.(to_string (datadir // main_binary)) ]) "--uuid=" ^ uuid ; "--platform=" ^ platform ;
Fpath.(to_string (datadir // main_binary)) ])
in in
Log.debug (fun m -> m "executing hooks with %s" args); Log.debug (fun m -> m "executing hooks with %s" args);
let dir = Fpath.(configdir / "upload-hooks") in let dir = Fpath.(configdir / "upload-hooks") in