Skip to content

Commit 7d753b3

Browse files
authored
build: Simplify tutor initialization (#34)
1 parent c197961 commit 7d753b3

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@ This sample plugin showcases the **Open edX Hooks Extension Framework**, which a
4646
### Option 1: Development with Tutor (Recommended)
4747

4848
```bash
49-
# Backend Plugin Setup
50-
tutor mounts add lms:$PWD/backend:/openedx/sample-plugin-backend
51-
tutor dev launch
52-
tutor dev exec lms pip install -e ../sample-plugin-backend
53-
tutor dev exec lms python manage.py lms migrate
54-
tutor dev restart lms
49+
# Backend plugin setup
50+
tutor mounts add "$PWD/backend"
51+
tutor dev launch # Rebuilds image, runs migrations, reboots containers.
5552

5653
# Frontend Plugin Setup (for learner-dashboard MFE development)
5754
npm install $PWD/frontend

tutor/tutorsampleplugin/plugin.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@
2121
# ---------------------------------------------------------------------------
2222
# Backend: Install the Django app plugin into LMS and CMS images
2323
# ---------------------------------------------------------------------------
24+
25+
# If a directory named "backend" has been moutned with `tutor mount add`, then
26+
# this line will ensure that the directory gets mapped into the openedx[-dev]
27+
# image and into the container's virtualenv. When there is no such directory
28+
# mounted, this line has no effect (thus it's safe for it to exist in the
29+
# production version of the plugin).
30+
hooks.Filters.MOUNTED_DIRECTORIES.add_item(("openedx", "backend"))
31+
2432
# The openedx-dockerfile-post-python-requirements patch runs after pip
2533
# installs the base Open edX requirements. Plugins installed here are
2634
# available in both LMS and CMS containers.
27-
# ---------------------------------------------------------------------------
2835

2936
hooks.Filters.ENV_PATCHES.add_item((
3037
"openedx-dockerfile-post-python-requirements",

0 commit comments

Comments
 (0)