diff --git a/_templates/_template_alerting_profile.tf b/_templates/_template_alerting.tf similarity index 100% rename from _templates/_template_alerting_profile.tf rename to _templates/_template_alerting.tf diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 00000000..7ffc9390 --- /dev/null +++ b/environment.yaml @@ -0,0 +1,12 @@ +EMEA_PROD: + - environments: [E2E,PROD] +EMEA_PREPROD: + - environments: [TEST,INT] +NA_PROD: + - environments: [E2E,PROD] +NA_PREPROD: + - environments: [TEST,INT] +CN_PROD: + - environments: [E2E,PROD] +CN_PREPROD: + - environments: [TEST,INT] \ No newline at end of file diff --git a/environments.yaml b/environments.yaml deleted file mode 100644 index e69de29b..00000000 diff --git a/onboarding.py b/onboarding.py index 9ea9e2d9..9aeed045 100644 --- a/onboarding.py +++ b/onboarding.py @@ -20,21 +20,23 @@ def main(slo_path): doc = yaml.safe_load(file) for item, doc in doc.items(): - envs = dict(doc[1]) + envs = dict(doc[0]) for configoption in configoptions: with open('./_templates/_template_'+configoption+'.tf') as file: data = file.read() data = data.replace("", args.appname) data = data.replace("", args.compassid.lower()) + #print('./'+item+'/'+configoption+'/'+args.appname+'.tf') with open('./'+item+'/'+configoption+'/'+args.appname+'.tf', 'w') as file: file.write(data) for envconfigoption in envconfigoptions: - for env in envs: + for env in envs.get("environments"): with open('./_templates/_template_'+envconfigoption+'.tf') as file: data = file.read() data = data.replace("", args.appname) data = data.replace("", args.compassid.lower()) data = data.replace("", env) + #print('./'+item+'/'+envconfigoption+'/'+args.appname+'_'+env+'.tf') with open('./'+item+'/'+envconfigoption+'/'+args.appname+'_'+env+'.tf', 'w') as file: file.write(data) else: