Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions playbooks/openedx_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@
when: not COMMON_ENABLE_DATADOG
- role: user_retirement_pipeline
when: COMMON_RETIREMENT_SERVICE_SETUP
- role: tinymce_plugins
when: (TINYMCE_ADDITIONAL_PLUGINS_LIST is defined) and (TINYMCE_ADDITIONAL_PLUGINS_LIST|length > 0)
8 changes: 8 additions & 0 deletions playbooks/roles/tinymce_plugins/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

tinymce_plugin_temp_dir: "{{ edxapp_code_dir }}/.temp_tinymce_plugin"

tinymce_dir: "{{ edxapp_code_dir }}/common/static/js/vendor/tinymce"
tinymce_plugins_dir: "{{ tinymce_dir }}/js/tinymce/plugins"

edx_jake_package: "{{ edxapp_code_dir }}/vendor_extra/tinymce/JakePackage.zip"
18 changes: 18 additions & 0 deletions playbooks/roles/tinymce_plugins/tasks/import_tinymce_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

- name: Add additional tinymce plugins
block:
- name: Clone plugin
git:
repo: "{{ plugin.repo }}"
dest: "{{ tinymce_plugin_temp_dir }}/{{ plugin.name }}"
version: "{{ plugin.version | default('master') }}"
accept_hostkey: true
key_file: "{% if EDXAPP_USE_GIT_IDENTITY %}{{ edxapp_git_identity }}{% endif %}"
- name: Move plugin to tinymce plugins directory
command: "cp -r {{ tinymce_plugin_temp_dir }}/{{ plugin.name }}{{ plugin.plugin_path | default('') }} {{ tinymce_plugins_dir }}"
Comment thread
pkulkark marked this conversation as resolved.
Resolved
- name: Clean temporary tinymce plugin repository
file:
state: absent
path: "{{ tinymce_plugin_temp_dir }}/{{ plugin.name }}"
become_user: "{{ edxapp_user }}"
10 changes: 10 additions & 0 deletions playbooks/roles/tinymce_plugins/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

- name: Import additional tinymce plugins
include_tasks: import_tinymce_plugin.yml
loop: "{{ TINYMCE_ADDITIONAL_PLUGINS_LIST }}"
loop_control:
loop_var: plugin

- name: Rebuild tinymce files
include_tasks: rebuild_tinymce_files.yml
43 changes: 43 additions & 0 deletions playbooks/roles/tinymce_plugins/tasks/rebuild_tinymce_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

- name: Minify tinymce plugin files
block:
- name: Unarchive JakePackage.zip
unarchive:
src: "{{ edx_jake_package }}"
dest: "{{ tinymce_dir }}"
remote_src: True
- name: Clean existing node modules
file:
state: absent
path: "{{ tinymce_dir }}/node_modules"
- name: Install npm dependencies from archive
shell: "npm install"
args:
chdir: "{{ tinymce_dir }}"
- name: Clean existing tinymce js files with jake
shell: "npx jake clean-js"
args:
chdir: "{{ tinymce_dir }}"
- name: Build tinymce with jake
shell: "npx jake minify bundle[themes:*,plugins:*]"
args:
chdir: "{{ tinymce_dir }}"
become_user: "{{ edxapp_user }}"

- name: Update static assets
command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets"

- name: Restart LMS
supervisorctl:
state: restarted
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
name: "lms"

- name: Restart CMS
supervisorctl:
state: restarted
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
name: "cms"