From 5a376ada8765c43a1e32eea4309fd85b505b0290 Mon Sep 17 00:00:00 2001 From: jem Date: Wed, 6 Nov 2019 19:53:05 +0100 Subject: [PATCH] refactor project if used for terraform --- src/main/python/ddadevops/meissa_build.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/python/ddadevops/meissa_build.py b/src/main/python/ddadevops/meissa_build.py index ad33200..93e3410 100644 --- a/src/main/python/ddadevops/meissa_build.py +++ b/src/main/python/ddadevops/meissa_build.py @@ -15,8 +15,21 @@ def hetzner_api_key(project): def stage(project): return project.get_property('stage') +def module(project): + return project.get_property('name') + def tf_import_name(project): return project.get_property('tf_import_name') def tf_import_resource(project): return project.get_property('tf_import_resource') + +def project_dict(project): + my_hetzner_api_key = hetzner_api_key(project) + my_module = project.name + ret = {'stage' : stage(project)} + if my_hetzner_api_key: + ret['hetzner_api_key'] = my_hetzner_api_key + if my_module: + ret['module'] = my_module + return ret \ No newline at end of file