From 527c3e9738184374910a32da94e4e9fa997ff31c Mon Sep 17 00:00:00 2001 From: Jhony Avella Date: Tue, 28 Feb 2023 03:36:13 -0500 Subject: [PATCH] feat: allowing customization of notes repo and version --- README.rst | 4 +++- tutornotes/plugin.py | 2 ++ tutornotes/templates/notes/build/notes/Dockerfile | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 18122d2..92ddd58 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Students notes plugin for `Tutor `_ =================================================================== -This is a plugin for `Tutor `_ to easily add the `Open edX note-taking app `_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation `_). +This is a plugin for `Tutor `_ to easily add the `Open edX note-taking app `_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation `_). .. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-olive.master/_images/SFD_SN_bodyexample.png :alt: Notes in action @@ -33,6 +33,8 @@ Configuration - ``NOTES_HOST`` (default: ``"notes.{{ LMS_HOST }}"``) - ``NOTES_MYSQL_DATABASE`` (default: ``"notes"``) - ``NOTES_MYSQL_USERNAME`` (default: ``"notes"``) +- ``NOTES_REPOSITORY`` (default: ``"https://github.com/openedx/edx-notes-api"``) +- ``NOTES_REPOSITORY_VERSION`` (default: ``"{{ OPENEDX_COMMON_VERSION }}"``) These values can be modified with ``tutor config save --set PARAM_NAME=VALUE`` commands. diff --git a/tutornotes/plugin.py b/tutornotes/plugin.py index e5f1d94..88c9972 100644 --- a/tutornotes/plugin.py +++ b/tutornotes/plugin.py @@ -20,6 +20,8 @@ "HOST": "notes.{{ LMS_HOST }}", "MYSQL_DATABASE": "notes", "MYSQL_USERNAME": "notes", + "REPOSITORY": "https://github.com/openedx/edx-notes-api", + "REPOSITORY_VERSION": "{{ OPENEDX_COMMON_VERSION }}", }, } diff --git a/tutornotes/templates/notes/build/notes/Dockerfile b/tutornotes/templates/notes/build/notes/Dockerfile index c401f30..01ac946 100644 --- a/tutornotes/templates/notes/build/notes/Dockerfile +++ b/tutornotes/templates/notes/build/notes/Dockerfile @@ -10,7 +10,7 @@ ARG APP_USER_ID=1000 RUN useradd --home-dir /app --create-home --shell /bin/bash --uid ${APP_USER_ID} app USER ${APP_USER_ID} -RUN git clone https://github.com/edx/edx-notes-api --branch {{ OPENEDX_COMMON_VERSION }} --depth 1 /app/edx-notes-api +RUN git clone {{ NOTES_REPOSITORY }} --branch {{ NOTES_REPOSITORY_VERSION }} --depth 1 /app/edx-notes-api WORKDIR /app/edx-notes-api RUN python -m venv /app/venv