From c8dca125065a859e9e088aa66425be519389069c Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 25 Jun 2021 10:12:43 +0200 Subject: [PATCH] expose get_commit_tag to global level --- src/main/python/ddadevops/__init__.py | 2 +- src/main/python/ddadevops/devops_build.py | 3 +++ src/main/python/ddadevops/devops_docker_build.py | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/python/ddadevops/__init__.py b/src/main/python/ddadevops/__init__.py index ce4ac73..c77c8f4 100644 --- a/src/main/python/ddadevops/__init__.py +++ b/src/main/python/ddadevops/__init__.py @@ -5,7 +5,7 @@ terraform, dda-pallet, aws & hetzner-cloud. """ from .credential import gopass_credential_from_env_path, gopass_credential_from_path, gopass_password_from_path, gopass_field_from_path -from .devops_build import DevopsBuild, create_devops_build_config, get_devops_build +from .devops_build import DevopsBuild, create_devops_build_config, get_devops_build, get_tag_from_latest_commit from .devops_terraform_build import WorkaroundTerraform, DevopsTerraformBuild, create_devops_terraform_build_config from .devops_docker_build import DevopsDockerBuild, create_devops_docker_build_config from .hetzner_mixin import HetznerMixin, add_hetzner_mixin_config diff --git a/src/main/python/ddadevops/devops_build.py b/src/main/python/ddadevops/devops_build.py index 1843714..ea8fd71 100644 --- a/src/main/python/ddadevops/devops_build.py +++ b/src/main/python/ddadevops/devops_build.py @@ -12,6 +12,9 @@ def create_devops_build_config(stage, project_root_path, module, def get_devops_build(project): return project.get_property('devops_build') +def get_tag_from_latest_commit(): + return run('git describe --abbrev=0 --tags', shell=True, capture_output=True).stdout.decode('UTF-8').rstrip() + class DevopsBuild: def __init__(self, project, config): diff --git a/src/main/python/ddadevops/devops_docker_build.py b/src/main/python/ddadevops/devops_docker_build.py index 99cfb32..e58d8e3 100644 --- a/src/main/python/ddadevops/devops_docker_build.py +++ b/src/main/python/ddadevops/devops_docker_build.py @@ -58,9 +58,6 @@ class DevopsDockerBuild(DevopsBuild): run('cp -f ' + self.docker_build_commons_path() + '* ' + self.build_path(), shell=True) - def get_tag_from_latest_commit(): - return run('git describe --abbrev=0 --tags', shell=True, capture_output=True).stdout.decode('UTF-8').rstrip() - def initialize_build_dir(self): super().initialize_build_dir() if self.use_package_common_files: