Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add restart script
  • Loading branch information
kthoden committed Jul 14, 2021
1 parent 7039b3d commit a57418b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions scripts/restart.py
@@ -0,0 +1,52 @@
#!/usr/bin/env python3

from utils.settings import BASE_DIR, load_config
from utils.functions import run

import subprocess
import shlex
import os
from time import sleep


def stop( env ):
# run application
subprocess.call(
"docker-compose down",
shell=True,
env=env
)

if __name__ == '__main__':

from argparse import ArgumentParser

config = load_config()

parser = ArgumentParser(
description="restart the webserver"
)
parser.add_argument(
"--build",
action = "store_true"
)
parser.add_argument(
"CMD",
nargs="*"
)

args = parser.parse_args()

stop( config )


CMD= \
(vars(args)['CMD'])
run(
env=config,
build = args.build,
cmd=CMD
)

print("\n------------------------------\n")
print("You can view the tail of container log output with 'docker-compose logs -f' (ctrl + c to stop).")

0 comments on commit a57418b

Please sign in to comment.