Skip to content

Commit

Permalink
test/boot-image: save bib image id as separate file
Browse files Browse the repository at this point in the history
On successful boot, save the bootc-image-builder image ID as a separate
(empty) file so we can save the boot success of multiple images and
avoid unnecessary rebuilds.

See osbuild#594
  • Loading branch information
achilleas-k committed Apr 15, 2024
1 parent d97682e commit a59435a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/scripts/boot-image
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,15 @@ def main():
# amend build info with boot success
# search_path is the root of the build path (build/build_name)
build_info["boot-success"] = True
if bib_image_id:
build_info["bib-id"] = bib_image_id
info_file_path = os.path.join(search_path, "info.json")
with open(info_file_path, "w", encoding="utf-8") as info_fp:
json.dump(build_info, info_fp, indent=2)
if bib_image_id:
# write a separate file with the bib image ID as filename to mark the boot success with that image
bib_id_file = os.path.join(search_path, f"bib-{bib_image_id}")
print(f"Writing bib image ID file: {bib_id_file}")
with open(bib_id_file, "w", encoding="utf-8") as fp:
fp.write("")


if __name__ == "__main__":
Expand Down

0 comments on commit a59435a

Please sign in to comment.