6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-11 09:35:06 +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 ## 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`` - [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] Rename lms/cms_worker to lms/cms-worker in local deployment
- [Improvement] Add the management plugin to the rabbitmq container - [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 may not be taken into account. It is useful for reloading settings, for instance. To
fully stop the platform, use the 'reboot' command.""", fully stop the platform, use the 'reboot' command.""",
) )
@click.argument("service") @click.argument("services", metavar="service", nargs=-1)
@click.pass_obj @click.pass_obj
def restart(context, service): def restart(context, services):
config = tutor_config.load(context.root) config = tutor_config.load(context.root)
command = ["restart"] command = ["restart"]
if service == "openedx": if "all" in services:
if config["ACTIVATE_LMS"]: pass
command += ["lms", "lms-worker"] else:
if config["ACTIVATE_CMS"]: for service in services:
command += ["cms", "cms-worker"] if "openedx" == service:
elif service != "all": if config["ACTIVATE_LMS"]:
command += [service] command += ["lms", "lms-worker"]
if config["ACTIVATE_CMS"]:
command += ["cms", "cms-worker"]
else:
command.append(service)
context.docker_compose(context.root, config, *command) context.docker_compose(context.root, config, *command)