expose get_commit_tag to global level

This commit is contained in:
jem 2021-06-25 10:12:43 +02:00
parent fd1373e96a
commit c8dca12506
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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):

View file

@ -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: