fixed output

This commit is contained in:
jem 2019-10-22 09:29:07 +02:00
parent ac1f6cf470
commit af3d9d6765
3 changed files with 10 additions and 4 deletions

View file

@ -27,7 +27,7 @@ use_plugin("python.distutils")
default_task = "publish" default_task = "publish"
name = "ddadevops" name = "ddadevops"
version = "0.3.0" version = "0.3.3"
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")]
@ -52,6 +52,7 @@ def initialize(project):
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Build Tools', 'Topic :: Software Development :: Build Tools',
]) ])

View file

@ -6,6 +6,6 @@ terraform, dda-pallet, aws & hetzner-cloud.
from .meissa_build import meissa_init_project, stage, hetzner_api_key, tf_import_name, tf_import_resource from .meissa_build import meissa_init_project, stage, hetzner_api_key, tf_import_name, tf_import_resource
from .dda_pallet import dda_write_target, dda_uberjar from .dda_pallet import dda_write_target, dda_uberjar
from .terraform import tf_copy_common, tf_plan, tf_import, tf_apply, tf_destroy, tf_read_output_json from .terraform import tf_copy_common, tf_plan, tf_import, tf_apply, tf_output, tf_destroy, tf_read_output_json
__version__ = "${version}" __version__ = "${version}"

View file

@ -34,13 +34,18 @@ def tf_import(project):
def tf_apply(project, auto_approve=None): def tf_apply(project, auto_approve=None):
init(project) init(project)
cmd = []
tf = Terraform(working_dir='.') tf = Terraform(working_dir='.')
if auto_approve: if auto_approve:
tf.apply(capture_output=False, auto_approve=True, var=get_hetzner_api_key_as_dict(project)) tf.apply(capture_output=False, auto_approve=True, var=get_hetzner_api_key_as_dict(project))
else: else:
tf.apply(capture_output=False, var=get_hetzner_api_key_as_dict(project)) tf.apply(capture_output=False, var=get_hetzner_api_key_as_dict(project))
tf.output(json=IsFlagged) tf_output(project)
def tf_output(project):
tf = Terraform(working_dir='.')
result = tf.output(json=IsFlagged)
with open(OUTPUT_JSON, "w") as output_file:
output_file.write(json.dumps(result))
def tf_destroy(project, auto_approve=None): def tf_destroy(project, auto_approve=None):
tf = Terraform(working_dir='.') tf = Terraform(working_dir='.')