Skip to content

Commit

Permalink
removing structure and changing some conf
Browse files Browse the repository at this point in the history
  • Loading branch information
nolan committed Jul 25, 2024
1 parent 1cdfe90 commit a5e907b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ resources:
header: Cloudfront
attributes:
- id
# kubernetes_secret:
# header: Secrets
# attributes:
kubernetes_secret:
header: Secrets
attributes:
- id
kubernetes_config_map:
header: Config map
attributes:
Expand Down
7 changes: 2 additions & 5 deletions gen-wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def process_directory(directory, config):
return markdown_content

def process_environment(environment, config, output_dir):
markdown_content = f"# {environment.capitalize()} Environment\n\n"
for root, dirs, files in os.walk(environment):
if '.terragrunt-cache' in root:
continue
Expand All @@ -102,7 +101,7 @@ def process_environment(environment, config, output_dir):
markdown_content += content

if markdown_content.strip() != f"# {environment.capitalize()} Environment\n\n":
output_file = os.path.join(output_dir, f"{environment}.md")
output_file = os.path.join(output_dir, f"{environment.capitalize()}-environment.md")
os.makedirs(output_dir, exist_ok=True)
with open(output_file, 'w') as f:
f.write(markdown_content)
Expand All @@ -118,10 +117,8 @@ def list_md_files(directory):
return md_files

def copy_wiki(md_files):
if not os.path.exists('temp_wiki/documentation/IaC'):
os.makedirs('temp_wiki/documentation/IaC')
for md_file in md_files:
subprocess.run(['cp', "terraform/live/" + md_file, 'temp_wiki/documentation/IaC'], check=True)
subprocess.run(['cp', "terraform/live/" + md_file, 'temp_wiki'], check=True)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Extract secrets using terragrunt state pull based on a YAML configuration.')
Expand Down

0 comments on commit a5e907b

Please sign in to comment.