store relative path for console and script
This commit is contained in:
parent
0628938898
commit
8279bc1c26
2 changed files with 6 additions and 6 deletions
|
@ -157,12 +157,12 @@ let console_of_string data =
|
||||||
Asn.console_to_cs console
|
Asn.console_to_cs console
|
||||||
|
|
||||||
let save_console_and_script datadir job_name uuid console script =
|
let save_console_and_script datadir job_name uuid console script =
|
||||||
let out name = Fpath.(datadir / job_name / Uuidm.to_string uuid / name + "txt") in
|
let out name = Fpath.(v job_name / Uuidm.to_string uuid / name + "txt") in
|
||||||
let script_out = out "script" in
|
let script_out = out "script" in
|
||||||
Bos.OS.File.write script_out script >>= fun () ->
|
Bos.OS.File.write Fpath.(datadir // script_out) script >>= fun () ->
|
||||||
let console_out = out "console" in
|
let console_out = out "console" in
|
||||||
console_to_string console >>= fun console_data ->
|
console_to_string console >>= fun console_data ->
|
||||||
Bos.OS.File.write console_out console_data >>= fun () ->
|
Bos.OS.File.write Fpath.(datadir // console_out) console_data >>= fun () ->
|
||||||
Ok (console_out, script_out)
|
Ok (console_out, script_out)
|
||||||
|
|
||||||
let read_console_and_script datadir console_file script_file =
|
let read_console_and_script datadir console_file script_file =
|
||||||
|
|
|
@ -274,8 +274,8 @@ let compute_input_id artifacts =
|
||||||
| Some a, Some b, Some c -> Some (Mirage_crypto.Hash.SHA256.digest (Cstruct.concat [a;b;c]))
|
| Some a, Some b, Some c -> Some (Mirage_crypto.Hash.SHA256.digest (Cstruct.concat [a;b;c]))
|
||||||
| _ -> None
|
| _ -> None
|
||||||
|
|
||||||
let save_console_and_script staging_dir datadir job_name uuid console script =
|
let save_console_and_script staging_dir job_name uuid console script =
|
||||||
let out name = Fpath.(datadir / job_name / Uuidm.to_string uuid / name + "txt") in
|
let out name = Fpath.(v job_name / Uuidm.to_string uuid / name + "txt") in
|
||||||
let out_staging name = Fpath.(staging_dir / name + "txt") in
|
let out_staging name = Fpath.(staging_dir / name + "txt") in
|
||||||
let console_to_string console =
|
let console_to_string console =
|
||||||
List.rev_map (fun (delta, data) ->
|
List.rev_map (fun (delta, data) ->
|
||||||
|
@ -318,7 +318,7 @@ let add_build
|
||||||
List.filter (fun (p, _) -> not (not_interesting p)) raw_artifacts
|
List.filter (fun (p, _) -> not (not_interesting p)) raw_artifacts
|
||||||
in
|
in
|
||||||
or_cleanup (prepare_staging staging_dir) >>= fun () ->
|
or_cleanup (prepare_staging staging_dir) >>= fun () ->
|
||||||
or_cleanup (save_console_and_script staging_dir datadir job_name uuid console job.Builder.script)
|
or_cleanup (save_console_and_script staging_dir job_name uuid console job.Builder.script)
|
||||||
>>= fun (console, script) ->
|
>>= fun (console, script) ->
|
||||||
or_cleanup (save_all staging_dir job uuid artifacts_to_preserve) >>= fun artifacts ->
|
or_cleanup (save_all staging_dir job uuid artifacts_to_preserve) >>= fun artifacts ->
|
||||||
let r =
|
let r =
|
||||||
|
|
Loading…
Reference in a new issue