6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-13 14:43:03 +00:00

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 # Changelog
## Latest
- [Improvement] Add `runserver top` command
## 3.0.4 (2019-02-13) ## 3.0.4 (2019-02-13)
- [Minor] Minimum required `click` version is 7.0 (#171) - [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), 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( @click.command(
help="Launch a shell", help="Launch a shell",
) )
@ -86,10 +91,13 @@ def docker_compose_run(root, edx_platform_path, edx_platform_settings, *command)
if edx_platform_path: if edx_platform_path:
run_command.append("--volume={}:/openedx/edx-platform".format(edx_platform_path)) run_command.append("--volume={}:/openedx/edx-platform".format(edx_platform_path))
run_command += command run_command += command
docker_compose(root, *run_command)
def docker_compose(root, *command):
return utils.docker_compose( return utils.docker_compose(
"-f", tutor_env.pathjoin(root, "local", "docker-compose.yml"), "-f", tutor_env.pathjoin(root, "local", "docker-compose.yml"),
"--project-name", "tutor_dev", "--project-name", "tutor_dev",
*run_command *command
) )
def service_port(service): def service_port(service):
@ -97,5 +105,6 @@ def service_port(service):
dev.add_command(run) dev.add_command(run)
dev.add_command(runserver) dev.add_command(runserver)
dev.add_command(stop)
dev.add_command(shell) dev.add_command(shell)
dev.add_command(watchthemes) dev.add_command(watchthemes)