6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-27 19:59:02 +00:00

Allow multiple services in "local restart" command

This commit is contained in:
Régis Behmo 2020-03-12 09:52:22 +01:00
parent 16819bd697
commit e2a3a2d912
2 changed files with 14 additions and 9 deletions

View File

@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
## Unreleased
- [Feature] Restart multiple services with `local restart`
- [Feature] Make it possible to easily reload openedx gunicorn process with `tutor local exec lms reload-gunicorn``
- [Improvement] Rename lms/cms_worker to lms/cms-worker in local deployment
- [Improvement] Add the management plugin to the rabbitmq container

View File

@ -62,18 +62,22 @@ restart all services. Note that this performs a 'docker-compose restart', so new
may not be taken into account. It is useful for reloading settings, for instance. To
fully stop the platform, use the 'reboot' command.""",
)
@click.argument("service")
@click.argument("services", metavar="service", nargs=-1)
@click.pass_obj
def restart(context, service):
def restart(context, services):
config = tutor_config.load(context.root)
command = ["restart"]
if service == "openedx":
if config["ACTIVATE_LMS"]:
command += ["lms", "lms-worker"]
if config["ACTIVATE_CMS"]:
command += ["cms", "cms-worker"]
elif service != "all":
command += [service]
if "all" in services:
pass
else:
for service in services:
if "openedx" == service:
if config["ACTIVATE_LMS"]:
command += ["lms", "lms-worker"]
if config["ACTIVATE_CMS"]:
command += ["cms", "cms-worker"]
else:
command.append(service)
context.docker_compose(context.root, config, *command)