6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-02-02 17:38:25 +00:00

Make it possible to run dev runserver for any service

This commit is contained in:
Régis Behmo 2020-01-08 22:26:14 +01:00
parent 52f094937c
commit 3540627691
3 changed files with 16 additions and 16 deletions

View File

@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
## Unreleased
- [Improvement] The `dev runserver` command can now be run for just any service
- 💥[Feature] `dev run/exec` commands now support generic options which are passed to docker-compose. Consequently, defining the `TUTOR_EDX_PLATFORM_PATH` environment variable no longer works. Instead, users are encouraged to explicitely pass the `-v` option or define a command alias.
## 3.9.1 (2020-01-08)

View File

@ -31,23 +31,16 @@ def dev(context):
help="Run a development server", context_settings={"ignore_unknown_options": True},
)
@click.argument("options", nargs=-1, required=False)
@click.argument("service", type=click.Choice(["lms", "cms"]))
@click.argument("service")
def runserver(options, service):
port = 8000 if service == "lms" else 8001
fmt.echo_info(
"The {} service will be available at http://localhost:{}".format(service, port)
)
args = [
"-p",
"{port}:{port}".format(port=port),
*options,
service,
"./manage.py",
service,
"runserver",
"0.0.0.0:{}".format(port),
]
if service in ["lms", "cms"]:
port = 8000 if service == "lms" else 8001
fmt.echo_info(
"The {} service will be available at http://localhost:{}".format(
service, port
)
)
args = ["--service-ports", *options, service]
compose.run.callback(args)

View File

@ -14,8 +14,14 @@ services:
lms:
<<: *openedx-service
command: ./manage.py lms runserver 0.0.0.0:8000
ports:
- "8000:8000"
cms:
<<: *openedx-service
command: ./manage.py cms runserver 0.0.0.0:8000
ports:
- "8001:8000"
lms_worker:
<<: *openedx-service
cms_worker: