diff --git a/CHANGELOG.md b/CHANGELOG.md index d6ee4ee..0243212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/tutor/commands/compose.py b/tutor/commands/compose.py index 884379b..c8cc76e 100644 --- a/tutor/commands/compose.py +++ b/tutor/commands/compose.py @@ -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)