diff --git a/README.rst b/README.rst index a09d0c4..031eea1 100644 --- a/README.rst +++ b/README.rst @@ -73,6 +73,18 @@ Then:: This last step should be performed every time you create new or make changes to existing programs. +Install extra requirements +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to install extra requirements, use DISCOVERY_EXTRA_PIP_REQUIREMENTS and re-build the docker image.:: + + tutor config save \ + --set 'DISCOVERY_EXTRA_PIP_REQUIREMENTS=["git+https://github.com/myusername/myplugin"]' + +Then, build the image, pointing to your fork if necessary:: + + tutor images build discovery + Debugging --------- diff --git a/tutordiscovery/plugin.py b/tutordiscovery/plugin.py index 56fab18..e6bae19 100644 --- a/tutordiscovery/plugin.py +++ b/tutordiscovery/plugin.py @@ -28,6 +28,7 @@ config = { "OAUTH2_KEY_SSO": "discovery-sso", "OAUTH2_KEY_SSO_DEV": "discovery-sso-dev", "CACHE_REDIS_DB": "{{ OPENEDX_CACHE_REDIS_DB }}", + "EXTRA_PIP_REQUIREMENTS": [], }, } diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index 623da00..f425a89 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -38,6 +38,9 @@ ENV PATH /openedx/nodeenv/bin:${PATH} # This is identical to "make production-requirements" but it was split in multiple # instructions to benefit from docker image caching RUN pip install -r requirements.txt +{% for extra_requirements in DISCOVERY_EXTRA_PIP_REQUIREMENTS %}RUN pip install '{{ extra_requirements }}' +{% endfor %} + ARG NPM_REGISTRY={{ NPM_REGISTRY }} RUN npm install --verbose --registry=$NPM_REGISTRY --production RUN ./node_modules/.bin/bower install --allow-root --production