fix terraform-build

This commit is contained in:
Michael Jerger 2023-05-22 09:51:29 +02:00
parent ed2f4d5ad0
commit 8b348771e0
2 changed files with 12 additions and 5 deletions

View file

@ -28,7 +28,7 @@ use_plugin("python.distutils")
default_task = "publish" default_task = "publish"
name = "ddadevops" name = "ddadevops"
version = "4.0.0-dev41" version = "4.0.0-dev44"
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
description = __doc__ description = __doc__
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]

View file

@ -44,7 +44,14 @@ def create_devops_terraform_build_config(stage,
class DevopsTerraformBuild(DevopsBuild): class DevopsTerraformBuild(DevopsBuild):
def __init__(self, project, config): def __init__(self, project, config):
super().__init__(project, config) inp = {}
inp["name"]=project.name
inp["module"]=config.get("module")
inp["stage"]=config.get("stage")
inp["project_root_path"]=config.get("project_root_path")
inp["build_types"]=[]
inp["mixin_types"]=[]
super().__init__(project, inp)
project.build_depends_on('dda-python-terraform') project.build_depends_on('dda-python-terraform')
self.additional_vars = config['additional_vars'] self.additional_vars = config['additional_vars']
self.output_json_name = config['output_json_name'] self.output_json_name = config['output_json_name']
@ -83,13 +90,13 @@ class DevopsTerraformBuild(DevopsBuild):
def copy_build_resources_from_dir(self): def copy_build_resources_from_dir(self):
run('cp -f ' + self.terraform_build_commons_path() + run('cp -f ' + self.terraform_build_commons_path() +
'* ' + self.build_path(), shell=False, check=False) '* ' + self.build_path(), shell=True, check=False)
def copy_local_state(self): def copy_local_state(self):
run('cp terraform.tfstate ' + self.build_path(), shell=False, check=False) run('cp terraform.tfstate ' + self.build_path(), shell=True, check=False)
def rescue_local_state(self): def rescue_local_state(self):
run('cp ' + self.build_path() + '/terraform.tfstate .', shell=False, check=False) run('cp ' + self.build_path() + '/terraform.tfstate .', shell=True, check=False)
def initialize_build_dir(self): def initialize_build_dir(self):
super().initialize_build_dir() super().initialize_build_dir()