aboutsummaryrefslogtreecommitdiffstats
path: root/deploy.py
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-20 21:19:29 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-20 21:20:55 +0100
commit0a07704d6dc53bf3a35d4aadfa240586f55e9487 (patch)
treedc7d45dfd0b74b58fa7f19d09c61b4981cd7dc25 /deploy.py
parent961c56632ba5c2e3937bced415697096ef8c8344 (diff)
Replace python installer
Diffstat (limited to 'deploy.py')
-rwxr-xr-xdeploy.py81
1 files changed, 0 insertions, 81 deletions
diff --git a/deploy.py b/deploy.py
deleted file mode 100755
index 4f373ee..0000000
--- a/deploy.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/python3
-import os
-
-from util.runners import run_step
-from util.exceptions import StepFailedError
-from util.helpers import check_preconditions
-from util.prompt import query_yes_no
-
-import yaml
-from termcolor import colored
-
-CWD = os.getcwd()
-OVERWRITE_FILES = os.getenv("OVERWRITE_FILES")
-
-
-def get_sections_meeting_preconditions(yaml):
- sections = {}
- for key, section in yaml["sections"].items():
- if not check_preconditions(section):
- continue
-
- sections[key] = section
-
- return sections
-
-
-def run_section(title, section):
- os.chdir(CWD)
- if "directory" in section:
- os.chdir(section["directory"])
- elif os.path.exists(title):
- os.chdir(title)
-
- for step in section["steps"]:
- if not check_preconditions(step):
- continue
-
- run_step(step)
-
-
-with open("info.yml", "r") as f:
- yaml = yaml.safe_load(f)
-
-sections = get_sections_meeting_preconditions(yaml)
-
-print("Sections to run: " + ", ".join(
- map(lambda x: colored(x, "green"), sections.keys())
-))
-print()
-
-if OVERWRITE_FILES == "1":
- print(colored("Warning: ", "red") + "you have requested overwrite mode!")
- print()
-
-if not query_yes_no("Proceed with install?", False):
- exit(1)
-
-section_count = 0
-total = len(sections.keys())
-notes = {}
-for key, section in sections.items():
- section_count += 1
- print(colored(f"[{section_count}/{total}] ", "white", attrs=["bold"])
- + "Section "
- + colored(key, "green"))
- try:
- run_section(key, section)
- if "notes" in section:
- notes[key] = section["notes"]
- except StepFailedError as e:
- print(colored("Step failed: ", "red") + str(e))
- print()
-
-if len(notes) > 0:
- print(colored(f"[Notes]", "white", attrs=["bold"]))
- print()
- for key, note in notes.items():
- print("From " + colored(key, "green") + ":")
- for message in note:
- print(f"- {message}")
- print()