mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-03-20 04:22:22 +00:00
Make it possible to run dev runserver
for any service
This commit is contained in:
parent
52f094937c
commit
3540627691
@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
|
|||||||
|
|
||||||
## Unreleased
|
## 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.
|
- 💥[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)
|
## 3.9.1 (2020-01-08)
|
||||||
|
@ -31,23 +31,16 @@ def dev(context):
|
|||||||
help="Run a development server", context_settings={"ignore_unknown_options": True},
|
help="Run a development server", context_settings={"ignore_unknown_options": True},
|
||||||
)
|
)
|
||||||
@click.argument("options", nargs=-1, required=False)
|
@click.argument("options", nargs=-1, required=False)
|
||||||
@click.argument("service", type=click.Choice(["lms", "cms"]))
|
@click.argument("service")
|
||||||
def runserver(options, service):
|
def runserver(options, service):
|
||||||
port = 8000 if service == "lms" else 8001
|
if service in ["lms", "cms"]:
|
||||||
|
port = 8000 if service == "lms" else 8001
|
||||||
fmt.echo_info(
|
fmt.echo_info(
|
||||||
"The {} service will be available at http://localhost:{}".format(service, port)
|
"The {} service will be available at http://localhost:{}".format(
|
||||||
)
|
service, port
|
||||||
args = [
|
)
|
||||||
"-p",
|
)
|
||||||
"{port}:{port}".format(port=port),
|
args = ["--service-ports", *options, service]
|
||||||
*options,
|
|
||||||
service,
|
|
||||||
"./manage.py",
|
|
||||||
service,
|
|
||||||
"runserver",
|
|
||||||
"0.0.0.0:{}".format(port),
|
|
||||||
]
|
|
||||||
compose.run.callback(args)
|
compose.run.callback(args)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,8 +14,14 @@ services:
|
|||||||
|
|
||||||
lms:
|
lms:
|
||||||
<<: *openedx-service
|
<<: *openedx-service
|
||||||
|
command: ./manage.py lms runserver 0.0.0.0:8000
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
cms:
|
cms:
|
||||||
<<: *openedx-service
|
<<: *openedx-service
|
||||||
|
command: ./manage.py cms runserver 0.0.0.0:8000
|
||||||
|
ports:
|
||||||
|
- "8001:8000"
|
||||||
lms_worker:
|
lms_worker:
|
||||||
<<: *openedx-service
|
<<: *openedx-service
|
||||||
cms_worker:
|
cms_worker:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user