diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index b025376e6..dc00025a2 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -585,6 +585,17 @@ EDXAPP_PRIVATE_REQUIREMENTS: # Caliper and xAPI event routing plugin - name: edx-event-routing-backends==5.5.6 +# List of additional npm packages that should be installed into the +# edxapp virtual environment. +# `name` (required) and `version_range` (optional) are supported and +# correspond to the options of ansible's pip module. +# Example: +# EDXAPP_EXTRA_NPM_REQUIREMENTS: +# - name: mypackage +# version_range: ^1.0.0 +# - name: git+https://git.myproject.org/MyProject#egg=MyProject +EDXAPP_EXTRA_NPM_REQUIREMENTS: [] + # List of custom middlewares that should be used in edxapp to process # incoming HTTP resquests. Should be a list of plain strings that fully # qualify Python classes or functions that can be used as Django middleware. diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index 136a1182e..9b942462a 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -317,6 +317,18 @@ - install - install:app-requirements +- name: Install private node dependencies + shell: "easy_install --version && npm install --no-save {{ item.name }}{{ '@' + item.version_range if item.version_range is defined else '' }}" + with_items: "{{ EDXAPP_EXTRA_NPM_REQUIREMENTS }}" + args: + chdir: "{{ edxapp_code_dir }}" + environment: "{{ edxapp_environment | combine(git_ssh_environment_mixin) }}" + become_user: "{{ edxapp_user }}" + when: "{{ EDXAPP_EXTRA_NPM_REQUIREMENTS }} | length > 0" + tags: + - install + - install:app-requirements + # The next few tasks set up the python code sandbox # need to disable this profile, otherwise the pip inside the sandbox venv has no permissions