From eb563bb27d7345e3ffb7fbfb25d032a1f62773e4 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 11 Mar 2025 16:22:16 +0500 Subject: [PATCH 1/4] chore: added npm aliases and step to install them --- playbooks/roles/edxapp/defaults/main.yml | 4 ++++ playbooks/roles/edxapp/tasks/deploy.yml | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index b025376e6..a9d7270f4 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -1128,6 +1128,10 @@ edxapp_npm_bin: "{{ edxapp_npm_dir }}/bin" edxapp_settings: '{{ EDXAPP_SETTINGS }}' EDXAPP_NODE_VERSION: "20" EDXAPP_NPM_VERSION: "10.7.0" + +NPM_ALIASES: + "@edx/brand": "npm:@edx/brand-edx.org@~2.0.0" + # This is where node installs modules, not node itself edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin" edxapp_user: edxapp diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index 136a1182e..2dcf2c983 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -166,7 +166,7 @@ tags: - install - install:app-requirements - + - name: Install local edxapp requirements command: "{{ edxapp_venv_dir }}/bin/pip install -e {{ edxapp_code_dir }}/." become_user: "{{ edxapp_user }}" @@ -317,6 +317,19 @@ - install - install:app-requirements +# Installing npm aliases +- name: Install NPM aliases + shell: > + npm install {{ item.value }} + args: + chdir: "{{ edxapp_code_dir }}" + environment: "{{ edxapp_environment | combine(git_ssh_environment_mixin) }}" + become_user: "{{ edxapp_user }}" + with_dict: "{{ NPM_ALIASES }}" + 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 From ce4c33f513758775fd879762adf914ec4ae9fe45 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Wed, 12 Mar 2025 12:14:35 +0500 Subject: [PATCH 2/4] fix: added mapping for alias intallation --- playbooks/roles/edxapp/tasks/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index 2dcf2c983..eb99e4ef9 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -320,7 +320,7 @@ # Installing npm aliases - name: Install NPM aliases shell: > - npm install {{ item.value }} + npm install {{ item.key }}@{{ item.value }} args: chdir: "{{ edxapp_code_dir }}" environment: "{{ edxapp_environment | combine(git_ssh_environment_mixin) }}" From 559192f124ff536a9b58468a6b1193ff8ac64a6b Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Mon, 24 Mar 2025 20:20:18 +0500 Subject: [PATCH 3/4] fix: added no-save flag in npm installation --- playbooks/roles/edxapp/tasks/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/edxapp/tasks/deploy.yml b/playbooks/roles/edxapp/tasks/deploy.yml index eb99e4ef9..470257dce 100644 --- a/playbooks/roles/edxapp/tasks/deploy.yml +++ b/playbooks/roles/edxapp/tasks/deploy.yml @@ -320,7 +320,7 @@ # Installing npm aliases - name: Install NPM aliases shell: > - npm install {{ item.key }}@{{ item.value }} + npm install {{ item.key }}@{{ item.value }} --no-save args: chdir: "{{ edxapp_code_dir }}" environment: "{{ edxapp_environment | combine(git_ssh_environment_mixin) }}" From 5bbf68e5d0586148728110d6fb8ef26b78672938 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Tue, 15 Apr 2025 18:25:24 +0500 Subject: [PATCH 4/4] chore: update edx-brand version --- playbooks/roles/edxapp/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index 0362f859d..18dbaa9d7 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -1125,7 +1125,7 @@ EDXAPP_NODE_VERSION: "20" EDXAPP_NPM_VERSION: "10.7.0" NPM_ALIASES: - "@edx/brand": "npm:@edx/brand-edx.org@~2.0.0" + "@edx/brand": "npm:@edx/brand-edx.org@^2.1.3" # This is where node installs modules, not node itself edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin"