From 1a41644e44d31bbb2865525c9ac0169e09635b3b Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Wed, 14 Apr 2021 16:37:48 +0200 Subject: [PATCH] Added option --enroot-bundle. --- ogscm/app/builder.py | 10 ++++++++++ ogscm/cli.py | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/ogscm/app/builder.py b/ogscm/app/builder.py index 0bb9c65..5df3533 100644 --- a/ogscm/app/builder.py +++ b/ogscm/app/builder.py @@ -77,3 +77,13 @@ class builder(object): shell=True, ) print(f"Wrote image file {self.image_file}") + + bundle_file = f"{self.image_file[:-5]}.run" + if self.__args.enroot_bundle and ( + not os.path.exists(bundle_file) or self.__args.force + ): + subprocess.run( + f"cd {self.__cwd} && rm -f {bundle_file} && enroot bundle -o {bundle_file} {self.image_file}", + shell=True, + ) + print(f"Wrote bundle file {bundle_file}") diff --git a/ogscm/cli.py b/ogscm/cli.py index c2c6c8e..725a0f9 100644 --- a/ogscm/cli.py +++ b/ogscm/cli.py @@ -110,6 +110,12 @@ def main(): # pragma: no cover action="store_true", help="Convert Docker image to enroot image", ) + build_g.add_argument( + "--enroot-bundle", + dest="enroot_bundle", + action="store_true", + help="Convert enroot image to enroot bundle", + ) build_g.add_argument( "--enroot_file", type=str, -- GitLab