Add `runserver stop` command

This commit is contained in:
Régis Behmo 2019-02-13 17:25:17 +01:00
parent da84299c8b
commit b3288613c7
2 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## Latest
- [Improvement] Add `runserver top` command
## 3.0.4 (2019-02-13)
- [Minor] Minimum required `click` version is 7.0 (#171)

View File

@ -46,6 +46,11 @@ def runserver(root, edx_platform_path, edx_platform_settings, service):
service, "./manage.py", service, "runserver", "0.0.0.0:{}".format(port),
)
@click.command(help="Stop a running development platform",)
@opts.root
def stop(root):
docker_compose(root, "rm", "--stop", "--force")
@click.command(
help="Launch a shell",
)
@ -86,10 +91,13 @@ def docker_compose_run(root, edx_platform_path, edx_platform_settings, *command)
if edx_platform_path:
run_command.append("--volume={}:/openedx/edx-platform".format(edx_platform_path))
run_command += command
docker_compose(root, *run_command)
def docker_compose(root, *command):
return utils.docker_compose(
"-f", tutor_env.pathjoin(root, "local", "docker-compose.yml"),
"--project-name", "tutor_dev",
*run_command
*command
)
def service_port(service):
@ -97,5 +105,6 @@ def service_port(service):
dev.add_command(run)
dev.add_command(runserver)
dev.add_command(stop)
dev.add_command(shell)
dev.add_command(watchthemes)