mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 06:07:56 +00:00
Get rid of the indexcourses
command
This command adds a burden on the `local` and `k8s` command. It does not make sense to provide this command out of the box, and not other administration commands. Instead, we should better document how to run regular `manage.py` commands from tutor. Close #269.
This commit is contained in:
parent
74b3baab47
commit
0fb9bfe008
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
Note: Breaking changes between versions are indicated by "💥".
|
Note: Breaking changes between versions are indicated by "💥".
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
- 💥[Improvement] Get rid of the `indexcourses` command (#269)
|
||||||
|
|
||||||
## 3.8.0 (2019-11-22)
|
## 3.8.0 (2019-11-22)
|
||||||
|
|
||||||
- [Improvement] Add `k8s-deployments-nginx-volume-mounts` patch
|
- [Improvement] Add `k8s-deployments-nginx-volume-mounts` patch
|
||||||
|
@ -108,14 +108,17 @@ After a fresh installation, your platform will not have a single course. To impo
|
|||||||
|
|
||||||
tutor local importdemocourse
|
tutor local importdemocourse
|
||||||
|
|
||||||
Updating the course search index
|
Running arbitrary ``manage.py`` commands
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The course search index can be updated with::
|
Any ``./manage.py`` command provided by Open edX can be run in a local platform deployed with Tutor. For instance, to delete a course, run::
|
||||||
|
|
||||||
|
tutor local run cms ./manage.py cms delete_course <your_course_id>
|
||||||
|
|
||||||
tutor local indexcourses
|
To update the course search index, run::
|
||||||
|
|
||||||
Run this command periodically to ensure that course search results are always up-to-date.
|
# Run this command periodically to ensure that course search results are always up-to-date.
|
||||||
|
tutor local run cms ./manage.py cms reindex_course --all --setup
|
||||||
|
|
||||||
.. _portainer:
|
.. _portainer:
|
||||||
|
|
||||||
|
@ -139,16 +139,6 @@ def importdemocourse(root):
|
|||||||
config = tutor_config.load(root)
|
config = tutor_config.load(root)
|
||||||
runner = K8sScriptRunner(root, config)
|
runner = K8sScriptRunner(root, config)
|
||||||
scripts.import_demo_course(runner)
|
scripts.import_demo_course(runner)
|
||||||
fmt.echo_info("Re-indexing courses")
|
|
||||||
indexcourses.callback(root)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command(help="Re-index courses for better searching")
|
|
||||||
@opts.root
|
|
||||||
def indexcourses(root):
|
|
||||||
config = tutor_config.load(root)
|
|
||||||
runner = K8sScriptRunner(root, config)
|
|
||||||
scripts.index_courses(runner)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command(name="exec", help="Execute a command in a pod of the given application")
|
@click.command(name="exec", help="Execute a command in a pod of the given application")
|
||||||
@ -237,6 +227,5 @@ k8s.add_command(delete)
|
|||||||
k8s.add_command(init)
|
k8s.add_command(init)
|
||||||
k8s.add_command(createuser)
|
k8s.add_command(createuser)
|
||||||
k8s.add_command(importdemocourse)
|
k8s.add_command(importdemocourse)
|
||||||
k8s.add_command(indexcourses)
|
|
||||||
k8s.add_command(exec_command)
|
k8s.add_command(exec_command)
|
||||||
k8s.add_command(logs)
|
k8s.add_command(logs)
|
||||||
|
@ -314,16 +314,6 @@ def importdemocourse(root):
|
|||||||
runner = ScriptRunner(root, config)
|
runner = ScriptRunner(root, config)
|
||||||
fmt.echo_info("Importing demo course")
|
fmt.echo_info("Importing demo course")
|
||||||
scripts.import_demo_course(runner)
|
scripts.import_demo_course(runner)
|
||||||
fmt.echo_info("Re-indexing courses")
|
|
||||||
indexcourses.callback(root)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command(help="Re-index courses for better searching")
|
|
||||||
@opts.root
|
|
||||||
def indexcourses(root):
|
|
||||||
config = tutor_config.load(root)
|
|
||||||
runner = ScriptRunner(root, config)
|
|
||||||
scripts.index_courses(runner)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command(
|
@click.command(
|
||||||
@ -381,5 +371,4 @@ local.add_command(https)
|
|||||||
local.add_command(logs)
|
local.add_command(logs)
|
||||||
local.add_command(createuser)
|
local.add_command(createuser)
|
||||||
local.add_command(importdemocourse)
|
local.add_command(importdemocourse)
|
||||||
local.add_command(indexcourses)
|
|
||||||
local.add_command(portainer)
|
local.add_command(portainer)
|
||||||
|
@ -88,7 +88,3 @@ def import_demo_course(runner):
|
|||||||
runner.check_service_is_activated("cms")
|
runner.check_service_is_activated("cms")
|
||||||
runner.run("cms", "hooks", "cms", "importdemocourse")
|
runner.run("cms", "hooks", "cms", "importdemocourse")
|
||||||
|
|
||||||
|
|
||||||
def index_courses(runner):
|
|
||||||
runner.check_service_is_activated("cms")
|
|
||||||
runner.run("cms", "hooks", "cms", "indexcourses")
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
|
export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
|
||||||
echo "Loading settings $DJANGO_SETTINGS_MODULE"
|
echo "Loading settings $DJANGO_SETTINGS_MODULE"
|
||||||
|
|
||||||
|
# Import demo course
|
||||||
git clone https://github.com/edx/edx-demo-course --branch open-release/ironwood.2 --depth 1 ../edx-demo-course
|
git clone https://github.com/edx/edx-demo-course --branch open-release/ironwood.2 --depth 1 ../edx-demo-course
|
||||||
python ./manage.py cms import ../data ../edx-demo-course
|
python ./manage.py cms import ../data ../edx-demo-course
|
||||||
|
|
||||||
|
# Re-index courses
|
||||||
|
./manage.py cms reindex_course --all --setup
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
|
|
||||||
echo "Loading settings $DJANGO_SETTINGS_MODULE"
|
|
||||||
|
|
||||||
./manage.py cms reindex_course --all --setup
|
|
Loading…
Reference in New Issue
Block a user