From f7b60f2c521fc8435a4f850805fbc5c907705f42 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 29 Jul 2023 10:55:18 +0200 Subject: [PATCH] version script improvements --- version.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/version.py b/version.py index c3ebe44c..0077a125 100644 --- a/version.py +++ b/version.py @@ -11,11 +11,12 @@ version_info = [] tandoor_tag = '' tandoor_hash = '' try: + print('getting tandoor version') r = subprocess.check_output(['git', 'show', '-s'], cwd=BASE_DIR).decode() tandoor_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=BASE_DIR).decode() tandoor_hash = r.split('\n')[0].split(' ')[1] try: - tandoor_tag = subprocess.check_output(['git', 'describe', '--exact-match', tandoor_hash], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)).decode().replace('\n', '') + tandoor_tag = subprocess.check_output(['git', 'describe', '--exact-match', tandoor_hash], cwd=BASE_DIR).decode().replace('\n', '') except: pass @@ -39,6 +40,7 @@ try: plugin_module = f'recipes.plugins.{d}.apps.{app_config_classname}' plugin_class = getattr(sys.modules[apps_path], app_config_classname) + print('getting plugin version for ', plugin_class.verbose_name if hasattr(plugin_class, 'verbose_name') else plugin_class.name) r = subprocess.check_output(['git', 'show', '-s'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)).decode() branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', d)).decode() commit_hash = r.split('\n')[0].split(' ')[1] @@ -56,8 +58,12 @@ try: 'branch': branch, 'tag': tag }) + except subprocess.CalledProcessError as e: + print("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) except Exception: traceback.print_exc() +except subprocess.CalledProcessError as e: + print("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output)) except: traceback.print_exc()