Added datetime logs

This commit is contained in:
Kevin Veen-Birkenbach 2025-05-15 18:49:52 +02:00
parent 2478e4013f
commit 9c45d070b4
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E

View File

@ -10,6 +10,8 @@ def run_ansible_vault(action, filename, password_file):
subprocess.run(cmd, check=True) subprocess.run(cmd, check=True)
def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str = None, password_file: str = None, verbose: int = 0, skip_tests: bool = False): def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str = None, password_file: str = None, verbose: int = 0, skip_tests: bool = False):
start_time = datetime.datetime.now().isoformat()
print(f"\n▶️ Script started at: {start_time}\n")
print("\n🛠️ Building project (make build)...\n") print("\n🛠️ Building project (make build)...\n")
subprocess.run(["make", "build"], check=True) subprocess.run(["make", "build"], check=True)
@ -39,6 +41,8 @@ def run_ansible_playbook(inventory: str, playbook: str, modes: dict, limit: str
print("\n🚀 Launching Ansible Playbook...\n") print("\n🚀 Launching Ansible Playbook...\n")
subprocess.run(cmd, check=True) subprocess.run(cmd, check=True)
end_time = datetime.datetime.now().isoformat()
print(f"\n✅ Script ended at: {end_time}\n")
def main(): def main():
# Change to script dir to execute all folders relative to their # Change to script dir to execute all folders relative to their
script_dir = os.path.dirname(os.path.realpath(__file__)) script_dir = os.path.dirname(os.path.realpath(__file__))