Reduce down time while updating
This commit is contained in:
parent
192f6c1444
commit
790e01866f
13
doxy/cli.py
13
doxy/cli.py
|
@ -89,12 +89,13 @@ def control(ctx, service, command):
|
||||||
@only_if_service_exists
|
@only_if_service_exists
|
||||||
def update(ctx, service, remove):
|
def update(ctx, service, remove):
|
||||||
compose_file = get_compose_file(Path(CONFIG.root_directory) / service)
|
compose_file = get_compose_file(Path(CONFIG.root_directory) / service)
|
||||||
command_chain = {
|
command_chain = [
|
||||||
f"Stopping {service}": ["down" if remove else "stop"],
|
(f"Pulling {service} images", ["pull"]),
|
||||||
f"Pulling {service} images": ["pull"],
|
(f"Starting {service}", ["up", "-d"]),
|
||||||
f"Starting {service}": ["up", "-d"],
|
]
|
||||||
}
|
if remove:
|
||||||
for title, command in command_chain.items():
|
command_chain.insert(0, (f"Stopping {service}", ["down"]))
|
||||||
|
for title, command in command_chain:
|
||||||
output.print_header(ctx, title)
|
output.print_header(ctx, title)
|
||||||
docker_compose_command(command, compose_file)
|
docker_compose_command(command, compose_file)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue