You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Flushing stream before calling subprocess
This commit is contained in:
@@ -18,6 +18,7 @@ containers = []
|
|||||||
# Stop containers
|
# Stop containers
|
||||||
def stop(exit_code):
|
def stop(exit_code):
|
||||||
print_logs()
|
print_logs()
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("docker-compose -f " + compose_file + " down", shell=True))
|
print(subprocess.check_output("docker-compose -f " + compose_file + " down", shell=True))
|
||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ def print_logs():
|
|||||||
#Iterating through docker container inspect list and print logs
|
#Iterating through docker container inspect list and print logs
|
||||||
for container in containers:
|
for container in containers:
|
||||||
print(Fore.LIGHTMAGENTA_EX + "Printing logs for: " + Fore.GREEN + container['Name'] + Style.RESET_ALL)
|
print(Fore.LIGHTMAGENTA_EX + "Printing logs for: " + Fore.GREEN + container['Name'] + Style.RESET_ALL)
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output('docker container logs ' + container['Name'], shell=True))
|
print(subprocess.check_output('docker container logs ' + container['Name'], shell=True))
|
||||||
|
|
||||||
#Iterating over hooks in test folder and running them
|
#Iterating over hooks in test folder and running them
|
||||||
@@ -72,17 +74,22 @@ def hooks():
|
|||||||
print("Running hooks")
|
print("Running hooks")
|
||||||
for test_file in sorted(os.listdir(test_path)):
|
for test_file in sorted(os.listdir(test_path)):
|
||||||
if test_file.endswith(".py"):
|
if test_file.endswith(".py"):
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("python3 " + test_path + test_file, shell=True))
|
print(subprocess.check_output("python3 " + test_path + test_file, shell=True))
|
||||||
elif test_file.endswith(".sh"):
|
elif test_file.endswith(".sh"):
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("./" + test_path + test_file, shell=True))
|
print(subprocess.check_output("./" + test_path + test_file, shell=True))
|
||||||
|
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("python3 tests/email_test.py", shell=True))
|
print(subprocess.check_output("python3 tests/email_test.py", shell=True))
|
||||||
|
|
||||||
# Start up containers
|
# Start up containers
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("docker-compose -f " + compose_file + " up -d", shell=True))
|
print(subprocess.check_output("docker-compose -f " + compose_file + " up -d", shell=True))
|
||||||
print()
|
print()
|
||||||
sleep()
|
sleep()
|
||||||
print()
|
print()
|
||||||
|
sys.stdout.flush()
|
||||||
print(subprocess.check_output("docker ps -a", shell=True))
|
print(subprocess.check_output("docker ps -a", shell=True))
|
||||||
print()
|
print()
|
||||||
health_checks()
|
health_checks()
|
||||||
|
|||||||
Reference in New Issue
Block a user