Skip to content

Commit

Permalink
prepare podman image tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Jul 3, 2024
1 parent 1f72702 commit d39e498
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mock/py/mock-isolated-repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,24 @@ def download_file(url, outputdir):
print(f"traceback for {url}")
raise


def _argparser():
parser = argparse.ArgumentParser()
parser.add_argument("--json", required=True)
parser.add_argument("--output-repo", required=True)
return parser


def prepare_image(image_specification, outputdir):
"""
Store the tarball into the same directory where the RPMs are
"""
subprocess.check_output(["podman", "pull", image_specification])
subprocess.check_output(["podman", "save", "--quiet", "-o",
os.path.join(outputdir, "bootstrap.tar"),
image_specification])


def _main():
options = _argparser().parse_args()

Expand All @@ -65,5 +76,7 @@ def _main():

subprocess.check_call(["createrepo_c", options.output_repo])

prepare_image(data["config"]["bootstrap_image"], options.output_repo)

if __name__ == "__main__":
_main()

0 comments on commit d39e498

Please sign in to comment.